Regular Expression
Sample Text Sandbox
Feel free to match with and manipulate patterns in this textbox:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!"#$%&'()*+,-./
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!"#$%&'()*+,-./
Simple English
Syntax: Regex to Simple English Guide
(?:abc)
literally abc
[abc]
one of "abc"
[^abc]
none of "abc"
[a-z]
letter
[A-Z]
uppercase
plain text string
literally "plain text string"
(letter)
capture (letter)
^
begin with
$
must end
?
optional
.
anything
Quantifiers
+
one or more
*
never or more
{1}
once
{2}
twice
{3}
exactly 3 times
{3,}
at least 3 times
{3,6}
between 3 and 6 times
Character classes
\d
digit
\D
no digit
\w
any character
\W
no character
\s
whitespace
\S
no whitespace
\b
word
\B
no word
\n
new line
\t
tab
\v
vertical tab
\\ Double backslash escapes itself. Use a single backslash for characters that usually have special handling. You can escape that character and it will be treated literally. For example \d will match a digit, while \\d will match a string that has a backslash followed by the letter d.
backslash
Flags
/regex/m
multi line
/regex/i
case insensitive
Coming Soon...
\r
carriage return
(?:a)(?=(?:X))
literally a if followed by X
(?:b)(?!(?:Y))
literally a if not followed by Y
Not supported
\1
Referencing a captured group
\b
backspace
\0
Null character
\cX
crtl-X
\uDDDD
unicode character DDDD
\f
form feed
Glossary
any character
\w
any of (letter, digit)
(?:[a-z]|[0-9])
anything
.
at least 3 times
{3,}
backslash
\\
between 3 and 6 times
{3,6}
capture a
(a)
case insensitive
/regex/i
digit
\d
digit from 3 to 5
[3-5]
either of (digit, letter)
(?:[0-9]|[a-z])
exactly 3
{3}
exactly 4 times
{4}
letter
[a-z]
letter from g to m
[g-m]
literally "stuff"
(?:stuff)
multi line
/regex/m
must end
$
never or more
*
new line
\n
no character
\W
no whitespace
\S
no word
\W
none of "xyz"
[^xyz]
number from 3 to 6
[3-6]
once
{1}
once or more
+
one of "defg123"
[defg123]
optional
?
raw [a-zA-Z]
[a-zA-Z]
starts with
^
tab
\t
twice
{2}
uppercase
[A-Z]
uppercase letter from D to Y
[D-Y]
vertical tab
\v
whitespace
\s
word
\b