code
ref
Cheat Sheets
Quick Reference
JSON Formatter
Learn
Tools
Browser Support
Search…
Ctrl K
Cheat Sheets
/
Tools
/
RegExp
RegExp
Regular expression syntax: classes, anchors, quantifiers, groups, lookarounds and flags.
Official reference ↗
Character Classes
Shorthand
.
\d
\D
\w
\W
\s
\S
Sets
[abc]
[^abc]
[a-z]
[A-Z0-9]
[\s\S]
Unicode
\p{L}
\p{Lu}
\p{N}
\p{Script=Greek}
\P{L}
Anchors & Boundaries
^
$
\b
\B
Lookaround
Lookahead
(?=x)
(?!x)
Lookbehind
(?<=x)
(?<!x)
Quantifiers
Greedy
*
+
?
{n}
{n,}
{n,m}
Lazy
*?
+?
??
{n,m}?
Groups & References
(x)
(?:x)
(?<name>x)
\1
\k<name>
x|y
(?i:x)
Escapes
\t
\n
\r
\v
\f
\0
\xhh
\uhhhh
\u{hhhh}
\cX
\.
\\
\/
Flags
g global
i ignoreCase
m multiline
s dotAll
u unicode
v unicodeSets
y sticky
d hasIndices
JavaScript Methods
RegExp
test()
exec()
lastIndex
source
flags
escape()
String
match()
matchAll()
replace()
replaceAll()
search()
split()
Replacement Patterns
$&
$1
$<name>
$`
$'
$$
Guides
Regular expressions guide
Cheatsheet
Groups and backreferences
Assertions