In summary, regexps can be:
abcd
-- matching a string literally
.
-- matching everything except NULL
[a-z_?]
, ^[a-z_?]
, [[:alpha:]]
and
[^[:alpha:]]
-- matching character sets
\(subexp\)
-- grouping an expression into a subexpression.
\n
-- match a copy of whatever was matched by the nth subexpression.
The following special characters and sequences can be applied to a character, character set, subexpression, or backreference:
*
-- repeat the preceeding element 0 or more times.
\+
-- repeat the preceeding element 1 or more times.
\?
-- match the preceeding element 0 or 1 time.
{m,n}
-- match the preceeding element at least m
, and as
many as n
times.
regexp-1\|regexp-2\|..
-- match any regexp-n.
A special character, like .
or *
can be made into a literal
character by prefixing it with \
.
A special sequence, like \+
or \?
can be made into a
literal character by dropping the \
.
Go to the first, previous, next, last section, table of contents.