Regular
Expressions
101
@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?
Regex Editor
Regex Library
Account
Regex Quiz
Settings
Live Help
Consider a donation
Become a sponsor
Save & Share
Save Regex
ctrl+s
Update Regex
ctrl+⇧+s
Flavor
PCRE2 (PHP >=7.3)
PCRE (PHP <7.3)
ECMAScript (JavaScript)
Python
Golang
Java 8
Function
Match
Substitution
List
Unit Tests
Tools
Code Generator
Sponsor
Jamstack at Scale
Explanation
/
(?:
(?:
\"

'

\]

\}

\\

\d

(?:
nan

infinity

true

false

null

undefined

symbol

math
)

\`

\

\+
)+
[
)
]
*
;
?
(
(?:
\s



~

!

{}

\\

\+
)*
.
*
(?:
.
*
=
.
*
)
)
)
/
gm
Noncapturing group
(?:
(?:
\"

'

\]

\}

\\

\d

(?:
nan

infinity

true

false

null

undefined

symbol

math
)

\`

\

\+
)+
[
)
]
*
;
?
(
(?:
\s



~

!

{}

\\

\+
)*
.
*
(?:
.
*
=
.
*
)
)
)
Noncapturing group
(?:
\"

'

\]

\}

\\

\d

(?:
nan

infinity

true

false

null

undefined

symbol

math
)

\`

\

\+
)+
+
matches the previous token between
one
and
unlimited
times, as many times as possible, giving back as needed
(greedy)
1st Alternative
\"
\"
matches the character
"
with index
34
_{10}
(
22
_{16}
or
42
_{8}
) literally (case sensitive)
2nd Alternative
'
'
matches the character
'
with index
39
_{10}
(
27
_{16}
or
47
_{8}
) literally (case sensitive)
3rd Alternative
\]
\]
matches the character
]
with index
93
_{10}
(
5D
_{16}
or
135
_{8}
) literally (case sensitive)
4th Alternative
\}
\}
matches the character
}
with index
125
_{10}
(
7D
_{16}
or
175
_{8}
) literally (case sensitive)
5th Alternative
\\
\\
matches the character
\
with index
92
_{10}
(
5C
_{16}
or
134
_{8}
) literally (case sensitive)
6th Alternative
\d
\d
matches a digit (equivalent to
[09]
)
7th Alternative
(?:
nan

infinity

true

false

null

undefined

symbol

math
)
Noncapturing group
(?:
nan

infinity

true

false

null

undefined

symbol

math
)
1st Alternative
nan
nan
matches the characters
nan
literally (case sensitive)
2nd Alternative
infinity
infinity
matches the characters
infinity
literally (case sensitive)
3rd Alternative
true
true
matches the characters
true
literally (case sensitive)
4th Alternative
false
false
matches the characters
false
literally (case sensitive)
5th Alternative
null
null
matches the characters
null
literally (case sensitive)
6th Alternative
undefined
7th Alternative
symbol
8th Alternative
math
8th Alternative
\`
\`
matches the character
`
with index
96
_{10}
(
60
_{16}
or
140
_{8}
) literally (case sensitive)
9th Alternative
\
\
matches the character

with index
45
_{10}
(
2D
_{16}
or
55
_{8}
) literally (case sensitive)
10th Alternative
\+
\+
matches the character
+
with index
43
_{10}
(
2B
_{16}
or
53
_{8}
) literally (case sensitive)
Match a single character present in the list below
[
)
]
*
matches the previous token between
zero
and
unlimited
times, as many times as possible, giving back as needed
(greedy)
)
matches the character
)
with index
41
_{10}
(
29
_{16}
or
51
_{8}
) literally (case sensitive)
;
matches the character
;
with index
59
_{10}
(
3B
_{16}
or
73
_{8}
) literally (case sensitive)
1st Capturing Group
(
(?:
\s



~

!

{}

\\

\+
)*
.
*
(?:
.
*
=
.
*
)
)
Noncapturing group
(?:
\s



~

!

{}

\\

\+
)*
*
matches the previous token between
zero
and
unlimited
times, as many times as possible, giving back as needed
(greedy)
1st Alternative
\s
\s
matches any whitespace character (equivalent to
[\r\n\t\f\v
\u00a0\u1680\u2000\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]
)
2nd Alternative


matches the character

with index
45
_{10}
(
2D
_{16}
or
55
_{8}
) literally (case sensitive)
3rd Alternative
~
~
matches the character
~
with index
126
_{10}
(
7E
_{16}
or
176
_{8}
) literally (case sensitive)
4th Alternative
!
!
matches the character
!
with index
33
_{10}
(
21
_{16}
or
41
_{8}
) literally (case sensitive)
5th Alternative
{}
{}
matches the characters
{}
literally (case sensitive)
6th Alternative
\\
\
matches the character

with index
124
_{10}
(
7C
_{16}
or
174
_{8}
) literally (case sensitive)
\
matches the character

with index
124
_{10}
(
7C
_{16}
or
174
_{8}
) literally (case sensitive)
7th Alternative
\+
\+
matches the character
+
with index
43
_{10}
(
2B
_{16}
or
53
_{8}
) literally (case sensitive)
.
matches any character (except for line terminators)
*
matches the previous token between
zero
and
unlimited
times, as many times as possible, giving back as needed
(greedy)
Noncapturing group
(?:
.
*
=
.
*
)
.
matches any character (except for line terminators)
*
matches the previous token between
zero
and
unlimited
times, as many times as possible, giving back as needed
(greedy)
=
matches the character
=
with index
61
_{10}
(
3D
_{16}
or
75
_{8}
) literally (case sensitive)
.
matches any character (except for line terminators)
*
matches the previous token between
zero
and
unlimited
times, as many times as possible, giving back as needed
(greedy)
Global pattern flags
g modifier:
g
lobal. All matches (don't return after first match)
m modifier:
m
ulti line. Causes
^
and
$
to match the begin/end of each line (not only begin/end of string)
Match Information
Your regular expression does not match the subject string.
Quick Reference
Regular Expression
v1
No Match
/
/
gm
Test String
Regular
Expressions
101
Please wait while the app is loading...
Please enable JavaScript to use this web application.