Regular Expressions Flashcards
1
Q
Character that denotes matching the start of a line
A
For example: grep -E “^[A-N]” filename.txt
Will match lines that start with any uppercase letter in the range A-N in the filename.txt file
2
Q
Character that denotes matching the end of a line
A
$
For example: grep -E “[A-N]$” filename.txt
Will match lines that end with any uppercase letter in the range A-N in the filename.txt file
3
Q
Match a range of characters
A
[A-Z]
4
Q
Match a specific set of characters
A
[ABCDE]
5
Q
Match excluding characters
A
[^A-M]
The ^ within the brackets is used as a NOT operator instead of the start of line operator