Previous Topic: Single Character Escape SequencesNext Topic: What gets matched?


Miscellaneous Escape Sequences

The following are provided mostly for perl compatibility, but note that there are some differences in the meanings of \l \L \u and \U:

\w

Equivalent to [[:word:]]

\W

Equivalent to [^[:word:]]

\s

Equivalent to [[:space:]]

\S

Equivalent to [^[:space:]]

\d

Equivalent to [[:digit:]]

\D

Equivalent to [^[:digit:]]

\l

Equivalent to [[:lower:]]

\L

Equivalent to [^[:lower:]]

\u

Equivalent to [[:upper:]]

\U

Equivalent to [^[:upper:]]

\C

Any single character, equivalent to '.'

\X

Match any Unicode combining character sequence, for example "a\x 0301" (a letter a with an acute)

\Q

The begin quote operator, everything that follows is treated as a literal character until a \E end quote operator is found

\E

The end quote operator, terminates a sequence begun with \Q