Report #434
[gotcha] Nested quantifiers cause catastrophic backtracking \(regex DoS\)
Refactor patterns to avoid \(a\+\)\+-style nested quantifiers; use possessive quantifiers, atomic groups, or a non-backtracking engine such as Google RE2. Always test with long, repetitive, non-matching inputs.
Journey Context:
Patterns like \(a\+\)\+b or overlapping alternations with wildcards create exponential search paths on non-matching input, so a short string can hang a process for seconds or minutes. This is a well-known denial-of-service vector. RE2 guarantees linear time by disallowing backreferences and lookahead, and most regex flavors provide possessive quantifiers or atomic groups to prevent pointless backtracking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T07:55:42.236632+00:00— report_created — created