|
c |
An ordinary character
(not one of the special characters discussed below) is a one character regular
expression that matches that character.
|
\c |
A backslash (\) followed by any special character is a one character
regular expression that matches the special character itself. The special
characters are:
|
! |
Logical
OR as in match
this!that!the_other. You may have to use {} for precedence
grouping.
|
# |
A hash mark followed by any regular expression matches any number
(including zero) occurrences of the regular expression.
|
? |
Matches exactly any one character.
W? matches
Wa, Wb, Wc, W1, W2, W3 ... |
* |
Matches any number of any character.
|
% |
Matches exactly nothing. It can be used in groups of ored patterns to specify
that an empty alternative is possible.
|
{} |
Curly brackets may be used to enclose patterns to specify a precedence
grouping, and may be nested.
{%!{test}}version matches the strings
testversion and
version. |
[string] |
|
A non empty string of characters enclosed in square brackets
is a one character regular expression that matches
any one character in that string.
If however the first character of the string is a circumflex (^),
the one character expression matches any character which is
not in the string. The ^ has this special meaning
only if it occurs first in the string. The minus (-) may be used to
indicate a range of consecutive ASCII characters; for example, [0-9] is
equivalent to
any one of the digits. The - loses its special meaning if it occurs
first (after an initial ^, if any) or last in the string.
The right square bracket (]) and the backslash (\)
must be quoted with a backslash if you want to use it within the
string. |
^ |
Matches the beginning of a line.
|
$ |
Matches the end of a line. (^*$ matches any entire line)
|
|