Regex Flashcards
Source: https://cheatography.com/davechild/cheat-sheets/regular-expressions/pdf/
1
Q
Anchors — what do they do?
A
Anchors do not match any character at all. Instead, they match a position before, after, or between characters.
source: https://www.regular-expressions.info/anchors.html
2
Q
*
A
Quantifier: 0 or more
3
Q
+
A
Quantifier: 1 or more
4
Q
?
A
Quantifier: 0 or 1
Can also be added to another quantifier to make it ungreedy
5
Q
{3}
A
Quantifier: Exactly 3
6
Q
{3,}
A
Quantifier: 3 or more
7
Q
{3,5}
A
Quantifier: 3, 4, or 5
8
Q
A
Anchor: Start of string, or start of line in a multi-line pattern
9
Q
\A
A
Anchor: Start of string
10
Q
$
A
Anchor: End of string, or end of line in multi-line pattern
11
Q
\Z
A
Anchor: End of string
12
Q
\b
A
Anchor: Word boundary
13
Q
\B
A
Anchor: Not word boundary
14
Q
\⋜
A
Anchor: Start of word
15
Q
>
A
Anchor: End of word