ReDoS Checker (Catastrophic Backtracking Detector)
A single badly-written regular expression can freeze a server. Patterns like (a+)+$ take exponentially longer to fail as the input grows — feed one a few dozen non-matching characters and the match can run for minutes. That is a ReDoS (Regular expression Denial of Service). This tool checks a pattern two ways: it statically detects the structures that cause catastrophic backtracking, and it actually measures how match time grows against a hostile input in your own browser, so you get real numbers, not just a warning.
How to use the ReDoS Checker (Catastrophic Backtracking Detector)
Paste the pattern into the Regular expression box. You can enter just the pattern body ((a+)+$) or a full JavaScript literal (/(a+)+$/i) — the tool strips the slashes and reads the flags for you. Add flags such as i or m in the second box if you are not using literal syntax. Click Check for ReDoS.
You get two panels. The first is the static verdict: the tool parses your pattern into a small syntax tree and looks for the three shapes that cause catastrophic backtracking — a nested unbounded quantifier such as (a+)+, an overlapping alternation under a quantifier such as (a|ab)*, and two adjacent quantifiers over the same characters such as \d+\d+. Each finding names the danger and gives a concrete fix.
The second panel is the live timing probe. The tool builds the worst-case input for your pattern — a run of matching characters followed by a character that forces the match to fail — and measures how long the match takes at growing input lengths, right in your browser. A safe pattern stays flat. A vulnerable one climbs steeply, and the probe aborts the moment a single match crosses 750 ms so it can never hang your tab. Everything runs locally; your pattern is never sent anywhere.
What the checker looks for
Backtracking regex engines (JavaScript, Python's re, Java, Ruby, PHP's PCRE, .NET) can take exponential time to fail a match when a pattern allows the same input to be split many ways. When an attacker controls the input, that is a ReDoS. The checker flags the three structures behind almost every real case:
- Nested quantifiers:
(a+)+,(a*)*,([a-z]+)*,(\w+\s?)*. Exponential. - Overlapping alternation under a quantifier:
(a|a)*,(a|ab)*,(\w|\d)+. Exponential. - Adjacent overlapping quantifiers:
\d+\d+,.*.*,\s*\s*. Usually quadratic, still enough to stall on long input.
For why these shapes explode, measured timings for (a+)+$ at growing input lengths, and how to rewrite a vulnerable pattern step by step, read the full guide: Catastrophic Backtracking and ReDoS: How to Tell If a Regex Will Hang.
Common use cases
- Reviewing a pull request. A new validation regex lands in a diff. Paste it here before approving — nested quantifiers hide easily in an innocent-looking email or URL validator.
- Auditing a dependency. A CVE mentions a ReDoS in a library's regex. Drop the reported pattern in to see the timing curve and confirm the severity for your own input sizes.
- Hardening user-facing search or filters. Any feature that compiles a regex from user input, or matches user input against a server-side pattern, is a ReDoS target. Test the pattern against the shape an attacker would send.
- Learning why a pattern is slow. If a log-parsing or scraping job occasionally hangs on certain lines, the timing probe shows whether the regex is the cause and which structure to rewrite.