Regex Tester
Tests regular expression matches live, so you can verify as you write.
Test regular expressions online with live match results — JavaScript flavor, toggle flags and capture groups instantly.
Steps and notes
What is Regex Tester — JavaScript Regex Tester Online?
The single most useful fact about testing regular expressions in a browser: JavaScript regex is not PCRE. Python-flavored constructs like named groups with single quotes, atomic groups or possessive quantifiers either fail to parse or mean something different here. Everything else follows the same engine the browser itself uses at runtime, which is exactly what makes this tester worth using — the match you see is the match your code will get, no translation layer. Two behaviors surprise people: the global flag changes what the result list means (all matches versus the first with capture groups), and an empty capture group and a group that did not participate are different things the plain text view flattens. Catastrophic backtracking is real — a nested-quantifier pattern against long input can hang the tab, which is why input length is bounded here. When a pattern works in another tool but not here, check flavor first, flags second, and escaping inside the character class third.
- Write the pattern in the top field (without the surrounding slashes)
- Enter the text to match in the bottom field
- Review the highlighted matches and capture groups
- Add the g flag for global matching, otherwise only the first match is reported
Frequently asked questions
- Why does my regex work in Python but not here?
- Different engines. JavaScript does not support atomic groups, possessive quantifiers or Python-style named-group syntax; lookbehind is supported in modern engines but was not in older browsers.
- What do the flags actually change?
- g collects all matches instead of the first; i ignores case; m makes ^ and $ match line boundaries inside multiline text. The tester shows matches per the flags you set, same as runtime.
- Can a regex freeze the page?
- Yes — nested quantifiers on long strings cause catastrophic backtracking. If the tester stops responding, simplify the pattern; this is a property of backtracking engines, not a bug.
- Why does a group match empty?
- A group that participated with zero width and one that did not participate are different. The highlighted match list shows positions; check group capture separately when debugging alternations.
Category: Development
Regex tools workflow
Regex Tester — JavaScript Regex Tester Online → Regex Cheat Sheet — Complete Regular Expression Reference