\ a |
The backslash character can have four different meanings depending on the context. It can:
-
Stand for itself
-
Quote the next character
-
Introduce an operator
-
Do nothing
|
*
|
Matches zero or more occurrences |
+
|
Matches one or more occurrences |
? |
Matches zero or one occurrence |
|
|
Alternation operator for specifying alternative matches |
^ b |
Matches the beginning of a string by default. In multiline mode, it matches the beginning of any line anywhere within the source string. |
$ b |
Matches the end of a string by default. In multiline mode, it matches the end of any line anywhere within the source string. |
. c |
Matches any character in the supported character set except NULL |
[ ] d |
Bracket expression for specifying a matching list that should match any one of the expressions represented in the list. A nonmatching list expression begins with a circumflex (^) and specifies a list that matches any character except for the expressions represented in the list. |
( ) |
Grouping expression, treated as a single subexpression |
{m} |
Matches exactly m times |
{m,} |
Matches at least m times |
{m,n} |
Matches at least m times but no more than n times |
\n e |
The backreference expression (n is a digit between 1 and 9) matches the nth subexpression enclosed between '(' and ')' preceding the \n |
[..] f |
Specifies one collation element, and can be a multicharacter element (for example, [.ch.] in Spanish) |
[: :] g |
Specifies character classes (for example, [:alpha:]). It matches any character within the character class. |
[==] h |
Specifies equivalence classes. For example, [=a=] matches all characters having base letter 'a'. |