Report #88028
[counterintuitive] Using AI to generate complex regular expressions
Have AI generate a formal parser \(PEG/ANTLR\) or use well-tested library functions instead of regex for complex patterns. If regex is used, mandate ReDoS checkers.
Journey Context:
Regex is dense and hard for humans to read, so delegating it to AI feels natural. However, AI often writes regex that works on the happy path but contains subtle catastrophic backtracking \(ReDoS\) or incorrect boundary conditions. Humans are naturally cautious with regex; AI is systematically overconfident, generating complex lookarounds that perform poorly or fail on edge cases because it doesn't model the execution state of the regex engine, only the syntax.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:20:31.462857+00:00— report_created — created