Regex Tester: Test JavaScript Regular Expressions Live
Write a pattern, paste test text and see what matches, where, and what each group captures.
- Works on your device. Nothing is uploaded.
- Free, no watermark
- No signup
How to use
- Type your regular expression (without the surrounding slashes).
- Paste the text to test and switch flags on or off.
- Read the highlighted matches and the table of positions and groups.
Good to know
The tester uses your browser's own JavaScript regex engine, so results match what your JavaScript or TypeScript code will do. Other languages (PCRE in PHP, Python re, Java) are similar but differ in details such as lookbehind and named-group syntax.
Matches are highlighted in alternating colours so neighbouring matches are easy to tell apart. The table lists each match with its position (counted in JavaScript characters from 0) and its capture groups as $1, $2… Empty matches are counted but not highlighted.
Some patterns, like (a+)+$, can take extremely long on certain text ("catastrophic backtracking"). The tester runs in a separate worker and stops a run after 5 seconds, so the page never freezes; if that happens, simplify the pattern.
Questions
Which regex flavour is this?
JavaScript (ECMAScript), as in Chrome, Firefox, Safari and Node.js.
Do I type the slashes?
No. Type only the pattern and use the flag switches.
How do I see capture groups?
They are listed for each match in the table as $1, $2 and so on.
Does it support Hindi?
Yes. Turn on the u flag to use \p{…} classes such as \p{Script=Devanagari}.
Is my text uploaded?
No. Everything runs in your browser.