Skip to content
BEAD

Regex Safety Analyzer

Flag catastrophic-backtracking shapes in regex patterns and probe with synthetic worst-case inputs.

High risk
This pattern has shapes known to cause exponential backtracking, or it slowed measurably on a synthetic worst case.
Findings (1)
Nested quantifier
A quantifier inside a group that is itself quantified is the canonical ReDoS pattern.
(a+)+
Synthetic worst-case probes
InputTime (ms)Matched
aaaaaaaa…(×10)!0.08yes
aaaaaaaa…(×20)!0.04yes
aaaaaaaa…(×25)!0.00yes
aaaaaaaa…(×28)!0.00yes

What we flag

  • Nested quantifiers — (a+)+, (a*)*
  • Alternation with overlap inside a quantifier — (a|a)*
  • Quantifier on a group containing a quantifier — classic ReDoS pattern
  • Unbounded greedy followed by an anchored suffix — slow-match risk
  • Excessive lookbehinds / lookaheads

Caveats

Heuristic only. We catch the obvious shapes that destroy real services; we don't prove safety. For high-stakes inputs, run the pattern against pathological strings or use a non-backtracking engine (RE2 / Hyperscan).

You might also like

Used in these workflows