How to use
- Enter a regular expression at the top and choose flags.
- Paste test text – every match is highlighted and listed with position and groups.
- Optionally enter a replacement using $1, $2 … and check the result.
Quick reference
\d digit, \w word character, \s whitespace, . any character, ^/$ start/end, * 0+, + 1+, ? 0–1, {n,m} n to m, [abc] character class, (…) group, (?<name>…) named group, a|b or.
The tester uses your browser's JavaScript regex engine. The syntax is largely compatible with PCRE (PHP), Python and Java, but details like lookbehind or flags can differ.
Frequently asked questions
Which regex flavor is used?
JavaScript (ECMAScript), including lookbehind, named groups and Unicode classes with the u flag.
What does the g flag do?
Without g only the first match is found; with g, all matches.
Why does the browser freeze with some patterns?
Nested quantifiers like (a+)+ can cause “catastrophic backtracking”. Simplify the pattern in that case.