🔍 Regex Tester
Write a pattern and watch matches highlight as you type, with every group and a replace preview.
🔒 Runs in your browser · files never uploaded
0Matches
0Capture groups
Highlighted
Match details
How to use the Regex Tester tool
- Enter a pattern and pick flags (g, i, m, s, u) – or start from a common pattern.
- Paste your test text; matches highlight live.
- Inspect groups in the match list and try a replacement with $1 or $<name>.
Frequently asked questions
Which regex flavour does this use?
Your browser's JavaScript (ECMAScript) engine – the same as Node.js and front-end code. It supports lookbehind, named groups (?<name>…) and Unicode property escapes like \p{L} with the u flag. PCRE-only features such as possessive quantifiers are not available.
Why does my pattern only find the first match?
Without the g (global) flag, JavaScript stops after the first match. The g flag is on by default here; if you untick it you will see one result.
What do the m and s flags do?
m makes ^ and $ match at the start and end of every line instead of the whole string. s (dotAll) lets . match newline characters.
How do I reference groups in the replacement?
Use $1, $2… for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign.