Basic Syntax Flashcards
Learn basic regular expression syntax! Much of this information is provided by http://www.regular-expressions.info/reference.html
\Q…\E
For example: \Q+-*/\E
Matches the characters literally, suppressing the meaning of special characters.
For example, match +-*/
\a
Matches the bell character
\e
Matches the escape character
\f
Matches the form feed character
\v
Matches the vertical tab character
[ ]
Symbol(s) used to encapsulate a character class. A character class matches a single character out of all the possibilities offered by the character class.
^ immediately following a [
Negates the character class, causing it to match a single character not listed in the character class.
\d
Matches a digit
\w
Matches word characters (letters, digits and underscores)
\s
Matches whitespace (spaces, tabs and linebreaks)
\D
Matches a character that is not a digit
\W
Matches a character that is not a word character (letters, digits, and underscores)
\S
Matches a character that is not a whitespace
\b
Matches a backspace character (inside a character class [ ] )
\t
Matches a tab character (inside a character class [ ] )