Basics Flashcards
Basic elements of regex
Indicates the start of the expression
Indicates the end of the expression
$
lowercase characters
[[:lower:]]
alphabetical characters
[[:alpha:]]
Numbers
[[:digits:]]
Punctuation
[[:punct:]]
Uppercase
[[:upper:]]
Wildcard for 1 character
.
Escape character
\
So when you need to search for a period, you’d enter .
Wildcard for multiple charcters
*
Check for a specific number of characters
{2n}\ for example ‘T.{2}n’
Back references
grep ‘(.)(\1)’ this finds any scenario where there are two identical charcters, side by side
What is a token
Symbol character that has a specific meaning, rather than purely it’s face value
What is a character class
A way to check for a specific set of characters
whitespace
[[:space:]]