Regex Tester
Build, test, and debug regular expressions live in your browser — with match highlighting and capture groups.
Live
Client-side
Highlighting
Match preview
Character classes
.Any character except newline\dDigit [0–9]\DNon-digit\wWord [a-zA-Z0-9_]\WNon-word\sWhitespace\SNon-whitespace[abc]Character set[^abc]Negated set[a-z]RangeQuantifiers
*0 or more (greedy)+1 or more (greedy)?0 or 1 (optional){n}Exactly n times{n,m}Between n and m+?1 or more (lazy)*?0 or more (lazy)Anchors & boundaries
^Start of string/line$End of string/line\bWord boundary\BNon-word boundaryGroups
(abc)Capture group(?:abc)Non-capturing group(?=abc)Positive lookahead(?!abc)Negative lookahead(?<=abc)Positive lookbehind(?<!abc)Negative lookbehinda|bAlternation (a or b)\1Backreference to group 1Escapes
\nNewline\tTab\rCarriage return\\Literal backslashFlags (click to toggle)
gGlobal — all matchesiCase insensitivemMultiline (^/$)sDot matches newlineuUnicode mode