Element |
Short Description |
\ |
Forces special characters to be treated as ordinary characters |
^ |
Indicates the beginning of the pattern (i.e., forces checking from the first character) |
$ |
Indicates the end of the pattern (i.e., forces checking until the last character) |
* |
Used when the preceding character or group may occur zero or more times |
+ |
Used when the preceding character or group may occur one or more times |
? |
Used when the preceding character or group may occur zero or one time |
. |
Represents any single character |
[abc] |
Represents any single character within the brackets |
[^abc] |
Represents any single character not within the brackets |
[a-z] |
Represents any single character within the specified range |
[^a-z] |
Represents any single character not within the specified range |
x|y |
Represents either "x" or "y" |
(pattern) |
Represents a group |
(?<name>pattern) |
Creates a named group |
{n} |
Represents when the preceding character or group occurs exactly "n" times |
{n,} |
Represents when the preceding character or group occurs "n" or more times |
{n,m} |
Represents when the preceding character or group occurs at least "n" and at most "m" times |
(?=…) |
Positive lookahead (requires a specific character or text to be present in the search context) |
(?!…) |
Negative lookahead (requires a specific character or text to be absent in the search context) |
(?<!-)\d |
Negative lookahead (Represents a digit not preceded by a negative sign) |
(?<=-)\d |
Positive lookahead (Represents a digit preceded by a negative sign) |
\b |
Represents the boundary between a word character and a non-word character |
\B |
Represents a position that is not a word boundary |
\d |
Represents a digit |
\D |
Represents a non-digit character |
\n or \r\n |
Represents a new line |
\s |
Represents a whitespace character |
\S |
Represents a non-whitespace character |
\t |
Represents a tab |
\w |
Represents a word character, including "_" but excluding other symbols |
\W |
Represents a non-word character, excluding "_" but including other symbols |