FREE TOOL
/ /

Characters

.Any character (except newline)
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word char
\sWhitespace
\SNon-whitespace
\bWord boundary

Quantifiers

*0 or more
+1 or more
?0 or 1 (optional)
{n}Exactly n
{n,}n or more
{n,m}Between n and m
*?Lazy 0 or more
+?Lazy 1 or more

Anchors & Groups

^Start of string/line
$End of string/line
(abc)Capture group
(?:abc)Non-capturing group
(?<name>abc)Named group
a|bAlternation (a or b)
[abc]Character class
[^abc]Negated class

Lookaround

(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
\1Backreference (group 1)
[a-z]Range (a to z)
\tTab character
\nNewline character

Test regular expressions in real-time. Everything runs in your browser — nothing is sent to a server.

Copied!