Regex Tester

Test regular expressions in real time. Highlights all matches, shows capture groups and index positions.

Regular Expression
/ /
g  global i  insensitive m  multiline s  dotAll u  unicode
Test String
Enter a pattern
Common Patterns
Quick Reference
.Any char except newline
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 / lazy
^Start of string/line
$End of string/line
\dDigit [0-9]
\DNon-digit
\wWord [a-zA-Z0-9_]
\WNon-word char
\sWhitespace
\SNon-whitespace
\bWord boundary
[abc]Character class
[^abc]Negated class
(abc)Capture group
(?:abc)Non-capture group
a|bAlternation (or)
{n,m}Between n and m
(?=...)Positive lookahead
(?!...)Negative lookahead
(?<=...)Lookbehind