Regex Tester

JavaScript syntax. Backslashes don't need to be escaped twice — type \d, not \\d.
Flags
Examples
2 matches
Send the report to alice@example.com and copy bob+test@dev.io. Skip not-a-real@.
Match #1from index 19 to 36
alice@example.com
Match #2from index 46 to 62
bob+test@dev.io.

Regex cheatsheet

A quick reference for the most useful regex tokens.

.any character except newline
\dany digit (0-9)
\wword character (letters, digits, _)
\sany whitespace
\Dany non-digit
^start of input (or line with m)
$end of input (or line with m)
\bword boundary
[abc]any of a, b, or c
[^abc]anything except a, b, or c
*zero or more of the previous
+one or more of the previous
?zero or one of the previous
{n}exactly n occurrences
{n,m}from n to m occurrences
(...)capturing group
(?:...)non-capturing group
a|bmatch a or b
(?=...)positive lookahead
(?<=...)positive lookbehind

About this tester

Test JavaScript regular expressions against any text right in your browser. Toggle flags, see every match with its position and capture groups, run a replacement, or split the text by the pattern. Nothing leaves your browser.