Regular expression character classes
Class |
Character matched
|
. |
Any character except newline, [^\n]
|
[...] |
Any one of the characters between the brackets
|
[^...] |
Any one character not one of the characters between the brackets
|
[\b] |
A backspace character (special syntax because of the \b boundary)
|
\d |
Any digit, [0-9]
|
\D |
Any character not a digit, [^0-9]
|
\s |
Any white space character, [ \t\n\r\f\v]
|
\S |
Any non-white space character, [^ \t\n\r\f\v]
|
\w |
Any word character, [a-zA-Z0-9_]
|
\W |
Any non-word character, [^a-zA-Z0-9_]
|
Regular expression anchor characters