In short: A regex tester runs a regular expression against sample text and highlights every match and capture group live, using the same JavaScript engine your code will use.
About Regex Tester
Regular expressions are compact and powerful, which is exactly why they are hard to get right on the first try. This tester runs your pattern against sample text on every keystroke, highlights each match, and lists the numbered and named capture groups so you can see what your code will actually receive.
It uses the JavaScript regex engine built into your browser, so the behavior matches String.prototype.match, matchAll and replace in Node.js and front-end code, including lookbehind, named groups and the u, s and y flags supported by modern browsers.
How to use Regex Tester
- Type your pattern without the surrounding slashes, for example
\d{3}-\d{4}. - Set flags:
gfor all matches,ito ignore case,mfor multiline anchors,sso the dot matches newlines,ufor Unicode. - Paste the text you want to test. Matches are highlighted instantly and listed with their position and groups.
- Optionally enter a replacement string to preview what
text.replace(regex, replacement)returns.
Examples
Pattern (\d{4})-(\d{2})-(\d{2}) with flag g matches both dates in the sample text. Groups 1–3 hold the year, month and day. 2026-3-9 is skipped because the month and day need two digits.
Pattern [ \t]+$ with flags gm and an empty replacement removes spaces and tabs at the end of every line — m makes $ match at each line break, not just the end of the text.
Frequently asked questions
Which regex flavor does this use?
JavaScript (ECMAScript) as implemented by your browser. Most syntax is shared with PCRE, Python and Java, but a few features differ: for example possessive quantifiers and atomic groups are not available in JavaScript.
Why do I only see one match?
Without the g (global) flag, JavaScript stops at the first match. Add g to find them all.
What happens if my pattern is very slow?
Some patterns, such as nested quantifiers like (a+)+$, can take exponential time on certain input. The tester caps the number of reported matches, but a catastrophic pattern may still freeze the tab for a moment; simplify the pattern if that happens.
Is my text uploaded?
No. Matching runs locally in your browser, so you can safely test patterns against logs or data you would not paste into a server.
Updated November 2026 · Free, no signup · How we build and test tools