Characters
Character | Description |
---|---|
Any character except [\^$.|?*+() |
All characters except the listed special characters match a single instance of themselves. { and } are literal characters, unless they're part of a valid regular expression token (e.g. the {n} quantifier). |
\ (backslash) followed by any of [\^$.|?*+(){} |
A backslash escapes special characters to suppress their special meaning |
\n |
Matches a LF character. Can be used in character classes |
\r |
Matches a CR character. Can be used in character classes |
\t |
Matches a TAB character. Can be used in character classes |
\a |
Matches a bell character (\x07). Can be used in character classes |
\e |
Matches an escape character (\x1B). Can be used in character classes |
\f |
Matches a form feed (\x0C). Can be used in character classes |
\v |
Matches a vertical tab (\x0B). Can be used in character classes |
\cA through \cZ |
Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A. Can be used in character classes |
\Q...\E |
Matches the characters between \Q and \E literally, suppressing the meaning of special characters |
\xXX where XX are 2 hexadecimal digits |
Matches the character with the specified ASCII/ANSI value. The value depends on the code page used. Can be used in character classes |