Coding and Data

Design adversarial tests for a regular expression

Name the engine because syntax and backtracking behaviour differ between JavaScript, Python, PHP, Java and .NET.

Prompt

MetaCyberGuru reviewed
Evaluate this regular expression as production input validation. Explain what it accepts, then design positive, negative and adversarial test cases. Include empty input, Unicode, extreme length, ambiguous boundaries and likely ReDoS cases. Do not claim the expression is safe unless the evidence supports it. Regex: [REGEX]. Intended rule: [RULE]. Engine: [ENGINE].

What to customize

  • REGEX
  • RULE
  • ENGINE

Expected output

A behaviour explanation, a runnable test matrix and a clear performance-risk assessment.

Check before you rely on it

AI output can be incomplete or wrong. Verify facts, run code, check citations and keep private data out of tools that your organization has not approved.

Related prompts

View the category