Report #47702
[counterintuitive] AI-generated regular expressions are safe and performant because the model understands formal grammars
Always run AI-generated regex through a static analyzer to check for catastrophic backtracking before deploying.
Journey Context:
AI frequently writes regex with catastrophic backtracking \(ReDoS\) because it predicts common regex tokens without simulating the NFA/DFA state machine. Humans who struggle with regex often write simpler, safer patterns, or test them explicitly for performance. AI's fluency in syntax masks its failure in runtime state explosion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:32:51.053062+00:00— report_created — created