Regex Tester
Test JavaScript regular expressions with live highlighting and groups.
100% in your browser — nothing uploadedTest a regular expression online
About this regex tester
Type a pattern and see results as you type: matches are highlighted directly in the test string, and a match list shows the position, the full match, and every numbered and named capture group. A replace preview expands $1 and $<name> references live, and the g, i, m, s, u, and y flags are toggled with checkboxes. Invalid patterns show the exact error from the engine instead of failing silently, and on huge inputs the display stops at the first 2,000 matches — the counter then reads 2,000+ so you know the highlighting is partial.
The tester runs your browser’s own JavaScript regex engine, so what matches here is exactly what will match in Node.js or front-end code — no approximations. Everything happens locally: neither the pattern nor the test text ever leaves your device, which makes it safe to debug against production logs, config files, or anything containing real data.
FAQ
Which regex flavor does this tester use?
JavaScript (ECMAScript) — the same engine your browser and Node.js run. Most syntax overlaps with PCRE and Python, but JavaScript has no atomic groups or possessive quantifiers, and lookbehind is unsupported in older Safari versions. If your pattern targets another language, double-check flavor-specific features.
What do the g, i, m, s, u, and y flags mean?
g finds every match instead of only the first; i ignores case; m makes ^ and $ match at each line break; s lets the dot match newlines; u enables full Unicode mode, so an emoji counts as one character; y (sticky) only matches starting exactly at the current position.
Why does my pattern make the page freeze?
That’s catastrophic backtracking: nested quantifiers like (a+)+ can force the engine to try an exponential number of combinations on text that almost matches. Because this tester runs the real engine locally, an expensive pattern hits your own tab. Make the inner pattern more specific or anchor it to avoid the blowup.