| . | | Any single character except a newline |
| ^ | | The beginning of the line or string |
| $ | | The end of the line or string |
| * | | Zero or more of the last character |
| + | | One or more of the last character |
| ? | | Zero or one of the last character |
| a.x | | a followed by ONE character then x |
| ^w | | w at the beginning of a line |
| ^wag | | wag at the beginning of a line |
| x$ | | x at the end of a line |
| xyz$ | | xyz at the end of a line |
| xyd* | | xy followed by zero or more d characters |
| .* | | Any string without a newline |
| ^$ | | A line with nothing in it. |
| [xyz] | | Either x or y or z |
| [^xyz] | | Neither x nor y nor z |
| [a-z] | | Anything from a to z inclusive |
| [^a-z] | | No lower case letters |
| [a-zA-Z] | | Any letter |
| [a-z]+ | | Any non-zero sequence of lower case letters |
| abc|xyz | | Either abc or xyz |
| (ab|xy)il | | Either abil or xyil |
| (ax)+ | | Either ax or axax or axaxax or... |
| \n | | A newline |
| \t | | A tab |
| \w | | Any alphanumeric (word) character.
The same as [a-zA-Z0-9_] |
| \W | | Any non-word character.
The same as [^a-zA-Z0-9_] |
| \d | | Any digit. The same as [0-9] |
| \D | | Any non-digit. The same as [^0-9] |
| \s | | Any whitespace character: space,
tab, newline, etc |
| \S | | Any non-whitespace character |
| \b | | A word boundary, outside [] only |
| \B | | No word boundary |
| \| | | Vertical bar |
| \[ | | An open square bracket |
| \) | | A closing parenthesis |
| \* | | An asterisk |
| \^ | | A carat symbol |
| \/ | | A slash |
| \\ | | A backslash |