| Metacharacter(s) | Meaning |
| . | Matches any character besides newline |
| () | Used for grouping characters |
| [] | Used for defining character classes |
| | | Used for or in regular expression |
| \ | Denotes the beginning of a character class abbreviation, or for the following metacharacter to be matched literally |
| * | Quantifier matches 0 or more of the previous character or group of characters |
| ? | Makes a quantifier nongreedy |
| ^ | Matches the beginning of a string (or line if /m is used) |
| $ | Matches the end of a string (or line if /m is used) |
| Character Class | Meaning |
| \d | digit or [0123456789] |
| \D | nondigit or [^0123456789] |
| \w | word (alphanumeric) or [a-zA-Z_0-9] |
| \W | nonword |
| \b | word boundary |
| \s | whitespace character [ \t\r\n\f] |
| \S | non whitespace character |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Isn't '+' a metacharacter too?
by Anonymous Monk on Jun 17, 2002 at 17:40 UTC | |
|
Re: Character Class Abbreviations
by Terminal (Initiate) on Dec 23, 2005 at 21:29 UTC | |
by planetscape (Chancellor) on Dec 24, 2005 at 00:19 UTC | |
|
Re: Character Class Abbreviations
by theantler (Beadle) on Mar 18, 2010 at 09:17 UTC |