Regex Tester
Test JavaScript regular expressions against sample text โ live match highlighting, capture groups, replace preview.
Last updated: April 2026 ยท Runs in your browser ยท No sign-up
- [9] max@example.com โ Gruppen: max, example.com
- [29] erna@test.de โ Gruppen: erna, test.de
Regex cheat sheet
\ddigit,\wword char,\swhitespace+one or more,*zero or more,?optional^line start,$line end,\bword boundary[abc]character class,[^abc]negated(a|b)alternation,(?=a)positive lookahead
Performance caveat
Nested quantifiers like (a+)+ on adversarial input can cause catastrophic backtracking (ReDoS). Keep patterns tight and test against worst-case inputs.
Frequently Asked Questions
Which regex flavour does it use?
JavaScript (ECMAScript) regex. That's nearly a superset of PCRE but with small differences โ notably no possessive quantifiers and no (?P<name>...) Python-style named groups (use (?<name>...) instead).
What flags are supported?
g (global), i (case-insensitive), m (multiline ^$ anchors), s (dotAll โ . matches newlines), u (Unicode), y (sticky). Combine as needed.
How do capture groups work?
Parentheses capture. (\w+) grabs a word. Use ?: for non-capturing groups: (?:abc). Named groups: (?<year>\d{4}). Backreferences: \1 or \k<year>.
Can I see what a replace does?
Yes. The replace pane shows the output of .replace(pattern, replacement), with $1, $2 etc. referring to capture groups.