Topic 9 - Regular Expressions Flashcards
matches any single character except newline
.
matches zero or more occurrence of the previous single character
*
escape character
\
matches the beginning of a line
matches the end of a line
$
do not use $ with double quotes - problems with the shell
-matches a single character in a set or range of characters
[..]
Eg: a[bc]
matches a string that has a followed by b or c
- combine […] with * to match repeated sets
[^…]
matches the complement of whats inside the square brackets
Eg: [^a-zA-Z] will match a string that does not have any of the English letters
\less-than-sign
matches the BEGINNING of a regular expression word
>
matches the END of a regex word
(….)
\n
- remembers a portion of regular expression
- recalls the remembered portion where n is a digit from 1 to 9
X{m}
X{m,n}
- matches exactly m repeated of the one character regular expression X
- matches m to n repeats of X
X{m,}
matches m or more repeats of X
matches simply m or fewer repeats of X
X{,m}
matches a string that has a $ before one digit
$\d
matches any string that starts with The
^The