Regex Tester
Test a regular expression live with match highlighting and capture groups.
Enter the regex body (without slashes).
About Regex Tester
The Regex Tester lets you build and debug regular expressions live: type a pattern and flags, paste a test string, and watch matches highlight in real time, with every match and capture group listed in detail. No more edit-run-squint loops in your test framework just to check a pattern.
It uses the JavaScript regex engine, so what you build here behaves exactly like patterns in Playwright, Cypress, Jest or any browser code. For patterns headed to other languages, the core syntax carries over with only minor dialect differences.
How to use
- Type your regular expression in "Pattern" (without surrounding slashes).
- Set "Flags" — g for all matches, i for case-insensitive, m for multiline are the common trio.
- Paste the text to test into "Test string"; matches highlight instantly in "Matches highlighted".
- Check "Match details" to see each match with its index and captured groups.
Frequently asked questions
Which regex flavor does this tester use?
JavaScript (ECMAScript), the same engine as browsers, Node.js, Playwright and Cypress. Most patterns port directly to Python or Java; the main differences are in lookbehind support and named-group syntax across older engines.
Why does my pattern only match once?
Add the g (global) flag. Without it, JavaScript regexes stop at the first match — the single most common surprise when testing patterns.
Can I see what my capture groups matched?
Yes — the "Match details" panel lists every match with its position and the content of each capture group, which is what you actually assert on in test code.
