Test your regular expressions in real-time with instant results. Perfect for developers to validate patterns quickly.
.
Any character except newline
[abc]
Any of a, b, or c
[^abc]
Not a, b, or c
[a-z]
Character between a to z
\d
Digit (0-9)
\D
Not a digit
\w
Word character (a-z, A-Z, 0-9, _)
\W
Not a word character
\s
Whitespace (space, tab, newline)
\S
Not whitespace
^
Start of string (or line in multiline)
$
End of string (or line in multiline)
\b
Word boundary
\B
Not word boundary
\A
Start of string (always)
\Z
End of string (before final newline)
\z
Absolute end of string
*
0 or more (greedy)
*?
0 or more (lazy)
+
1 or more (greedy)
+?
1 or more (lazy)
?
0 or 1
{n}
Exactly n times
{n,}
n or more times
{n,m}
Between n and m times
(...)
Capturing group
(?P<name>...)
Named capturing group
(?:...)
Non-capturing group
\1, \2
Backreferences to groups
(?=...)
Positive lookahead
(?!...)
Negative lookahead
(?<=...)
Positive lookbehind
(?<!...)
Negative lookbehind
\n
Newline
\r
Carriage return
\t
Tab
\v
Vertical tab
\f
Form feed
\0
Null character
\xHH
Character with hex code HH
\uHHHH
Unicode character
^\d+$
Numeric string
^[a-zA-Z]+$
Letters only
^\w+$
Alphanumeric + underscore
^[a-zA-Z0-9]+$
Alphanumeric
^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$
Email (basic)
^https?://[^\s/$.?#].[^\s]*$
URL (basic)
^(\d{3})-\d{3}-\d{4}$
US phone number
^\d{5}(-\d{4})?$
US ZIP code
Click on a pattern to insert it into the regex input field.