Regex Lab
//g
Test String
Match Results
Enter a pattern and test string to see matches

Characters

.Any character
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word
\sWhitespace
\SNon-whitespace

Anchors

^Start of string
$End of string
\bWord boundary

Quantifiers

*0 or more
+1 or more
?0 or 1
{n}Exactly n
{n,m}Between n and m

Groups & Logic

[abc]Character class
[^abc]Negated class
(...)Capture group
(?:...)Non-capturing
(?=...)Positive lookahead
(?!...)Negative lookahead
|Alternation

Common Patterns