Professional Documents
Culture Documents
0 or more
\A
Start of string
1 or more
(a|b)
a or b
0 or 1
(...)
Group
\Z
End of string
{3}
Exactly 3
(?:...)
\b
Word boundary
{3,}
3 or more
[abc]
Range (a or b or c)
\B
{3,5}
3, 4 or 5
[^abc]
Not a or b or c
\<
Start of word
[a-q]
Letter from a to q
\>
End of word
[A-Q]
[0-7]
Digit from 0 to 7
\n
nth group/subpattern
\c
Control character
\Q
\s
White space
\E
\S
\d
Digit
Global match
\D
Not digit
Case-insensitive
\w
Word
Multiple lines
\W
Not word
\x
Hexadecimal digit
\O
Octal digit
Evaluate replacement
Ungreedy pattern
[:upper:]
<
>
[:lower:]
[:alpha:]
All letters
[:alnum:]
[:digit:]
Digits
[:xdigit:]
Hexadecimal digits
[:punct:]
Punctuation
[:blank:]
[:space:]
Blank characters
[:cntrl:]
Control characters
[:graph:]
Printed characters
[:print:]
[:word:]
New line
\r
Carriage return
\t
Tab
\v
Vertical tab
\f
Form feed
\xxx
\xhh
Hex character hh
$2
"xyz" in /^(abc(xyz))$/
$1
"xyz" in /^(?:abc)(xyz)$/
$`
$'
$+
$&
Lookahead assertion
?!
Negative lookahead
?<=
Lookbehind assertion
?!= or ?<!
Negative lookbehind
?>
Once-only Subexpression
?()
?()|
?#
Comment
Cheatographer
Cheat Sheet
Sponsor
cheatography.com/davechild/
Try it free!
www.addedbytes.com
http://www.FeedbackFair.com