Regexp Flashcards
1
Q
a or b
A
a|b
2
Q
Insert entire match
A
$&
3
Q
The character a
A
a
4
Q
Null character
A
\0
5
Q
One non-whitespace
A
\S
6
Q
Tab
A
\t
7
Q
Hexadecimal character YY
A
\xYY
8
Q
Ignore case
A
i
9
Q
End of string
A
$
10
Q
Insert Y’th captured group
A
$Y
11
Q
Positive lookahead
A
(?=…)
12
Q
One whitespace
A
\s
13
Q
Word boundary
A
\b
14
Q
Start of string
A
15
Q
One word character
A
\w
16
Q
One character except: a, b, c, d
A
[^ab-d]
17
Q
Non-capturing group
A
(?:…)
18
Q
One non-word character
A
\W
19
Q
Inserts $
A
$$
20
Q
Non-word boundary
A
\B
21
Q
Between 2 and 5
A
{2, 5}
22
Q
Octal character YYY
A
\YYY
23
Q
Escapes a special character
A
\
24
Q
Exactly 2
A
{2}
25
Insert following string
$'
26
Capturing group
(...)
27
Carriage return
\r
28
Negative lookahead
(?!...)
29
^ and $ match start and end of line
m
30
Insert preceding string
$`
31
Newline
\n
32
Match the Y'th captured group
\Y
33
0 or more a's
a*
34
Backspace character
[\b]
35
0 or more
*
36
One character of: a, b, c, d
[ab-d]
37
2 or more
{2,}
38
Any character except newline
.
39
One non-digit
\D
40
One digit
\d
41
Hexadecimal character YYYY
\uYYYY
42
The string ab
ab
43
1 or more
+
44
0 or 1
?
45
Control character Y
\cY
46
Global Match
g