Regex Flashcards
1
Q
Digits
A
\d
2
Q
Whitespace
A
\s
3
Q
Word characters (num and alph)
A
\w
4
Q
No digits
A
\D
5
Q
No Whitespaces
A
\S
6
Q
No word char (num and alph)
A
\W
7
Q
Zero or more occurances
A
*
8
Q
One or more occurences
A
+
9
Q
Zero or one occurance
A
?
10
Q
5 or more times ‘a’
A
a{5,}
11
Q
Or
A
(One|two)
12
Q
Substitude
A
re.sub(‘tochange’, ‘changeto’, text)