Regex Tester

Build and test regular expressions with live match highlighting, group extraction, and replace mode.

/ /
Test String
Highlighted Matches
Quick Reference
Characters
.Any char except newline \d \DDigit / non-digit \w \WWord char / non-word \s \SWhitespace / non-ws \b \BWord boundary [abc]Character class [^abc]Negated class [a-z]Range
Quantifiers
* + ?0+, 1+, 0 or 1 {n} {n,} {n,m}Exact, at least, range *? +? ??Lazy (non-greedy)
Groups & Anchors
(abc)Capture group (?:abc)Non-capture group (?<name>abc)Named group a|bAlternation ^ $Start / end of line (?=...) (?!...)Lookahead (?<=...) (?<!...)Lookbehind