Regex Rules Flashcards
1
Q
abc…
A
Letters
2
Q
123…
A
Digits
3
Q
\d
A
Any digit
4
Q
\D
A
Any non Digit character
5
Q
.
A
Any character
6
Q
.
A
Period
7
Q
[abc]
A
Only a, b, or c
8
Q
[^abc]
A
Not a, b, nor c
9
Q
[a-z]
A
Characters a to z
10
Q
[0-9]
A
Numbers zero to 9
11
Q
\w
A
Any alphanumeric character. So a letter or a number.
12
Q
\W
A
Any non alpha numeric character (symbols, punctuation, etc)
13
Q
{m}
A
M repetitions
14
Q
{m,n}
A
M to n repetitions
15
Q
*
A
Zero or more repetitions
16
Q
+
A
One or more repetitions
17
Q
?
A
Optional character
18
Q
\s
A
Any whitespace
19
Q
\S
A
Any non whitespace character
20
Q
^…$
A
Starts and ends
21
Q
(…)
A
Capture group
22
Q
(a(b,c))
A
Capture sub group
23
Q
(.*)
A
Capture all
24
Q
(abc|def)
A
Matched abc or def
25
Q
\s, \n, \t, \r
A
White space, new line, tab, carriage return