Regexp Flashcards
a or b
a|b
Insert entire match
$&
The character a
a
Null character
\0
One non-whitespace
\S
Tab
\t
Hexadecimal character YY
\xYY
Ignore case
i
End of string
$
Insert Y’th captured group
$Y
Positive lookahead
(?=…)
One whitespace
\s
Word boundary
\b
Start of string
One word character
\w
One character except: a, b, c, d
[^ab-d]
Non-capturing group
(?:…)
One non-word character
\W
Inserts $
$$
Non-word boundary
\B
Between 2 and 5
{2, 5}
Octal character YYY
\YYY
Escapes a special character
\
Exactly 2
{2}
Insert following string
$’
Capturing group
(…)
Carriage return
\r
Negative lookahead
(?!…)
^ and $ match start and end of line
m
Insert preceding string
$`
Newline
\n
Match the Y’th captured group
\Y
0 or more a’s
a*
Backspace character
[\b]
0 or more
*
One character of: a, b, c, d
[ab-d]
2 or more
{2,}
Any character except newline
.
One non-digit
\D
One digit
\d
Hexadecimal character YYYY
\uYYYY
The string ab
ab
1 or more
+
0 or 1
?
Control character Y
\cY
Global Match
g