Free tools
Regex Tester
Test a JavaScript regular expression and inspect every match.
Processed in your browser. Your input is not uploaded.
Input
Paste text or read a local text file. Input is never saved in browser storage.
Flags: g, i, m, s, u, y. Matches are capped at 1,000; slow expressions are stopped.
Result
Your result will appear here.
About this tool
Try JavaScript regular expressions against text and inspect the returned matches. The tool runs matching in a separate Worker so a slow expression can be stopped without indefinitely blocking the page.
When to use it
- Check a pattern before using it in code.
- Inspect positional or named captures.
- Compare the effect of matching flags.
How to use it
- Enter a pattern, flags and sample text.
- Find matches and review values, positions and captures.
- Copy or download the returned match data.
Input and output example
Input
Pattern: [A-Z]-\d+ Flags: g Text: A-1024 and B-8
Output
Two matches: A-1024 and B-8.
Important details
- Syntax follows the browser’s JavaScript RegExp engine, not every other regex dialect.
- A run is stopped after about 1.5 seconds; results are capped at 1,000 matches and a capture-size budget.
- Positions use JavaScript string indexes; long table values are shortened only for display.
Frequently asked questions
Why is a pattern stopped?
Some expressions are expensive for a particular input. Simplify the pattern or reduce the input rather than removing the guard.
Are named captures supported?
Yes, when supported by the browser engine. They are returned as named group values.