/ /
Match
Replace
Split
Finds all matches of the pattern in the text.
Test String
Matches
No matches

Character classes

\dany digit (0-9)
\Dany non-digit
\wword char (a-z, 0-9, _)
\Wnon-word char
\swhitespace
\Snon-whitespace
.any char (except \n)
[abc]any of a, b, c
[^abc]not a, b, c
[a-z]range

Quantifiers

*0 or more
+1 or more
?0 or 1
{n}exactly n times
{n,}n or more
{n,m}between n and m
*?lazy (least)

Anchors

^start of string/line
$end of string/line
\bword boundary
\Bnot word boundary

Groups & alternation

(...)capture group
(?:...)non-capture group
(?<n>...)named group
\1backref to group 1
a|ba or b

Lookaround

(?=...)positive lookahead
(?!...)negative lookahead
(?<=...)positive lookbehind
(?<!...)negative lookbehind

Flags

gglobal (all matches)
icase insensitive
m^/$ per line
sdot matches newline