Regex Performance Tester
Run a regex for real in your browser with timing, match counts, and a static analysis that flags catastrophic backtracking patterns before they freeze your production code.
FreeOnline Tool
Loading…
How to Use
Enter the regex in the 'Regular expression' box, pick flags (g, gi, gm, gim or none), and paste the text to match against in the 'Test text' box. A backtracking risk analysis runs as you type: nested quantifiers and repeated groups are flagged with a risk level, an explanation and rewrite suggestions. Click 'Run test' to execute the regex in the browser with timing, showing match count, elapsed time and the first 10 matches. If the run times out or takes more than 1 second, a clear warning is shown.
Features
- Executes the regex locally in the browser with real timing and match counts
- Static detection of catastrophic backtracking patterns, rated none, low, medium, high or critical
- Per-pattern explanations with concrete rewrite suggestions
- Shows the first 10 matches and reports how many more remain
- Timeout and 1-second warnings, with safe and dangerous sample regexes
Use Cases
Regex health check before release
Test regexes triggered by user input before shipping to catch patterns that could stall your service
Tune parsing regexes
Benchmark different ways to write a log or text parsing regex and compare their actual timings
Learn about backtracking
Load the built-in dangerous sample (a+)+b to see catastrophic backtracking in action and understand why nested quantifiers are risky
Validate form input patterns
Verify the behavior and speed of email or phone validation regexes so hostile input cannot freeze the page
FAQ
Does the test run locally?
Yes. Matching and timing happen entirely in the browser, so nothing is uploaded and you can safely test against sensitive text
What is catastrophic backtracking?
When a regex contains nested quantifiers such as (a+)+b and the text does not match, the engine can try an exponential number of paths and hang. The tool detects these patterns statically and warns you
Which flags are supported?
Presets cover g, gi, gm and gim, or choose 'None' for no flags
What happens on timeout?
The test has a timeout guard; hitting it means the regex may be prone to catastrophic backtracking. Prefer non-greedy or atomic constructs, or an alternative approach