|
Regular Expression - \. - matching special characters
There are special (non printable) characters and Regular Expression metacharacters that need to use a slash to be matched.
Additionally, there are character classes and groups that are a shorthand way of expressing commonly used groups of characters.
| Non Printable Characters | Matches With... |
| \n | New Line Character |
| \t | Tab Character |
| \f | Form Feed Character |
| \r | Carriage Return Character |
| \v | Vertical Tab Character |
| Character Groups | Matches With... |
| \d | Any digit [0-9] |
| \D | Any character other than a digit |
| \w | Any letter (A-Z,a-z), digit [0-9] or underscore (_) |
| \W | Any character that is not a letter, digit or underscore |
| \s | Any white space character [ \t\r\n\v\f] |
| \S | Any character that is not a white space character |
| \b | A word boundary (matches just before first character of a word and just after last character of a word) |
| \B | Any character that is not a word boundary |
| Matching Characters that are Special | Matches With... |
| \. | A full stop (.) |
| \* | An asterisk (*) |
| \? | A question mark (?) |
| \+ | A plus sign (+) |
| \\ | A back slash (\) |
Computing Articles
|