About this tool
Debug JavaScript patterns without letting excessive backtracking freeze the page, then inspect bounded match and capture evidence before reuse.
Regex Tester is designed for debugging patterns against real sample text, not just memorizing syntax. It is especially helpful when you need to confirm flags, inspect all matches, and understand exactly where a validation or parsing pattern is succeeding or failing.
- Runs each expression in a disposable Web Worker and terminates evaluation after 750 ms to contain excessive backtracking.
- Respects JavaScript g, i, m, s, u, v, y, and d semantics, including first-match behavior and Unicode zero-length advancement.
- Preserves numbered, named, non-participating, and indexed captures and exports structured match or replacement evidence.
How to use Regex Tester
Enter the regular expression, choose the flags you need, and test it against representative input text rather than a trivial sample. Review the match list and indexes after each change so you can see whether the pattern is genuinely correct or just accidentally matching the happy path.
When this tool is useful
- Runs each expression in a disposable Web Worker and terminates evaluation after 750 ms to contain excessive backtracking.
- Respects JavaScript g, i, m, s, u, v, y, and d semantics, including first-match behavior and Unicode zero-length advancement.
- Preserves numbered, named, non-participating, and indexed captures and exports structured match or replacement evidence.
Examples you can test
Load an example, compare the result with the expected output, then replace it with your own input.
Email-like field check
Example input
Pattern: ^[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}$
Sample: editor@example.comExpected output
Match: editor@example.com
Useful for basic form validation tests, but production email validation should still allow for real-world edge cases and server-side checks.
Extract IDs from logs
Example input
Pattern: order_[0-9]+ Sample: created order_1842, retried order_1843
Expected output
Matches: order_1842, order_1843
This is a practical debugging pattern because it checks repeated matches in context instead of validating one isolated string.
Validation checklist
- Test at least one valid example, one invalid example, and one edge case before copying a pattern.
- Check whether the global, multiline, or case-insensitive flags change the match list.
- Review capture groups separately when the regex will feed another script, parser, or replacement workflow.