Regex tester and debugger
Regex tester for JavaScript regular expressions. See matches highlighted as you type, toggle flags and check every capture group. Runs offline.
How to test a regular expression
Type a pattern into the pattern box, without the surrounding slashes, and paste sample text below it. Every match is highlighted as you type. Turn the global, ignore case, multiline, dotall, unicode and sticky flags on or off and the results update. A count shows how many matches were found.
Inspect capture groups
A table lists each match, where it sits in the text, and what every capture group caught. It helps you debug a complex pattern before it goes into your code.
Same engine as your JavaScript
Patterns run on the browser's own RegExp engine, so results match what your JavaScript or TypeScript code will do. Input length and match loops are capped, so a bad pattern can't freeze the page.
Check groups before you ship
A table lists each match with its position in the text and what every capture group caught, in order. Use it to check that a date pattern really captures the year, month and day in the groups your code expects, before you ship it. Input is limited to 100,000 characters so a slow pattern can't freeze the page.
Before you start
Regex Tester works on the text or values you enter. Output: Matches. The settings appear before anything runs, so you can check them first. Your original file is never changed.
The value you enter is processed in your browser. Still test the output where it will be used. Clean formatting does not prove the data is safe or correct.
Keep the original until you have opened and checked the result. The work happens in this browser tab, so the size you can handle depends on your device's memory, your browser and the file itself.
How to use the regex tester and debugger
- Type your regular expression.
- Turn on the flags you need, such as global or ignore case.
- Paste sample text to test against.
- Check the highlighted matches and the capture group table.
Last updated · How we build and check tools · Report an error