Character classes
In the following table, you can find the patterns for character classes, which tell the Regex to match a single character:
Pattern |
Description |
Example |
---|---|---|
|
This matches any character, except newline or another unicode line terminator, such as ( |
|
|
This matches any alphanumeric character, including the underscore. It is equivalent to |
|
|
This matches any single nonword character. It is equivalent to |
|
|
This matches any single digit. It is equivalent to |
|
|
This matches any non digit. It is equivalent to |
|
|
This matches any single space character. It is equivalent to |
|
|
This matches any single nonspace character. It is equivalent to |
|
Literals
In the following table, you can find the patterns for literal characters, which tell the Regex to match a special character:
Pattern |
Description |
Example |
---|---|---|
|
These match themselves literally. |
|
|
This matches a | |
|
This matches a newline character. | |
|
This matches a form feed character. | |
|
This matches a carriage return character. | |
|
This matches a tab character. | |
|
This matches a vertical tab character. | |
|
This matches a backspace character. | |
|
This matches the ASCII character, expressed by the |
|
|
This matches the ASCII character, expressed by the |
|
|
This matches the ASCII character, expressed by the |
|
|
This indicates whether the next character is special and is not to be interpreted literally. |
|