Regex Tester
Privacy: all regex matching happens locally in your browser. Nothing is uploaded to any server.
Regex Tester
Test regular expressions online with live match highlighting, built-in pattern explanation, replace preview, and a common patterns library — all local.
Flags: g flag is required for match highlighting
Warning: very long input or complex patterns may freeze your browser. Use with caution.
Matches
Matches (0)
- No matches found
Pattern explanation
- Type a pattern to see its explanation
Regex cheat sheet
Anchors
^start of line$end of line\bword boundary\Bnon-word boundary\Astart of input\Zend of input
Character classes
.any char (except newline)\ddigit (0-9)\wword char (a-z, A-Z, 0-9, _)\swhitespace[abc]one of: a, b, c[^abc]not one of: a, b, c
Quantifiers
*zero or more+one or more?zero or one{n}exactly n{n,}n or more{n,m}n to m
Groups
(abc)capture group(?:abc)non-capturing group(?<name>abc)named groupa|balternation\1backreference
Lookarounds
(?=abc)positive lookahead(?!abc)negative lookahead(?<=abc)positive lookbehind(?<!abc)negative lookbehind