Topic 9 - Regular Expressions Flashcards
1
Q
”.”
A
matches any single character except newline
2
Q
“*”
A
matches zero or more occurrence of the previous single character
3
Q
\ (backslash)
A
escape character
4
Q
^ (caret)
A
matches the beginning of a line
5
Q
$
A
matches the end of a line
do not use $ with double quotes - problems with the shell
6
Q
[…]
A
- matches a single character in a set or range of characters
- combine […] with * to match repeated sets
7
Q
[^…]
A
matches the complement of whats inside the square brackets
8
Q
\less-than-sign
A
matches the BEGINNING of a regular expression word
9
Q
>
A
matches the END of a regex word
10
Q
(….)
\n
A
- remembers a portion of regular expression
- recalls the remembered portion where n is a digit from 1 to 9
11
Q
X{m}
X{m,n}
A
- matches exactly m repeated of the one character regular expression X
- matches m to n repeats of X
12
Q
X{m,}
A
matches m or more repeats of X
13
Q
X{,m}
A
matches simply m or fewer repeats of X