About Regex Tester
Validate patterns and flags, then list indexes, captures, named groups, and highlighted matches with defensive limits.
Regex Tester compiles a JavaScript expression with selected flags and reports up to 500 matches, including indexes, numbered captures, and named groups. Test input is capped at two million characters.
How to use it
- Enter or select your source data.
- Adjust the available options and run the tool.
- Review, copy, or download the result.
Common use cases
- Develop validation or extraction patterns for browser and Node.js code.
- Inspect capture groups before using a replacement operation.
- Test multiline log, URL, identifier, or text-matching expressions.
Worked example
Test (?<year>\d{4}) against dates and inspect the named group.
Limitations and responsible use
- JavaScript regex syntax and features are not identical to PCRE, Python, Java, or .NET.
- Catastrophic backtracking can still freeze the tab because JavaScript regex execution cannot be safely interrupted.
- The 500-match display cap limits rendering, not necessarily the conceptual number of matches.
Frequently asked questions
Why is global matching always used?
The tester adds the global flag so it can enumerate every match rather than stopping at the first.
Can it prove a regex is safe from ReDoS?
No. Review ambiguous repetition and test adversarial input before using a pattern on untrusted server data.