<row>
<entry> <literal>\d</literal> </entry>
<entry> matches any digit, like
<literal>[[:digit:]]</literal> </entry>
</row>
<row>
<entry> <literal>\s</literal> </entry>
<entry> matches any whitespace character, like
<literal>[[:space:]]</literal> </entry>
</row>
<row>
<entry> <literal>\w</literal> </entry>
<entry> matches any word character, like
<literal>[[:word:]]</literal> </entry>
</row>
<row>
<entry> <literal>\D</literal> </entry>
<entry> matches any non-digit, like
<literal>[^[:digit:]]</literal> </entry>
</row>
<row>
<entry> <literal>\S</literal> </entry>
<entry> matches any non-whitespace character, like
<literal>[^[:space:]]</literal> </entry>
</row>
<row>
<entry> <literal>\W</literal> </entry>
<entry> matches any non-word character, like
<literal>[^[:word:]]</literal> </entry>
</row>
</tbody>
</tgroup>
</table>
<para>
The class-shorthand escapes also work within bracket expressions,
although the definitions shown above are not quite syntactically
valid in that context.
For example, <literal>[a-c\d]</literal> is equivalent to
<literal>[a-c[:digit:]]</literal>.
</para>
<table id="posix-constraint-escapes-table">
<title>Regular Expression Constraint Escapes</title>
<tgroup cols="2">
<thead>
<row>
<entry>Escape</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>\A</literal> </entry>
<entry> matches only at the beginning of the string
(see <xref linkend="posix-matching-rules"/> for how this differs from
<literal>^</literal>) </entry>
</row>
<row>
<entry> <literal>\m</literal> </entry>
<entry> matches only at the beginning of a word </entry>
</row>
<row>
<entry> <literal>\M</literal> </entry>
<entry> matches only at the end of a word </entry>
</row>
<row>
<entry> <literal>\y</literal> </entry>
<entry> matches only at the beginning or end of a word </entry>
</row>
<row>
<entry> <literal>\Y</literal> </entry>
<entry> matches only at a point that is not the beginning or end of a
word </entry>
</row>
<row>
<entry> <literal>\Z</literal> </entry>
<entry> matches only at the end of the string
(see <xref linkend="posix-matching-rules"/> for how this differs from
<literal>$</literal>) </entry>
</row>
</tbody>
</tgroup>
</table>
<para>
A word is defined as in the specification of
<literal>[[:<:]]</literal> and <literal>[[:>:]]</literal> above.
Constraint escapes are illegal within bracket expressions.
</para>
<table id="posix-constraint-backref-table">
<title>Regular Expression Back References</title>
<tgroup cols="2">
<thead>
<row>
<entry>Escape</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>\</literal><replaceable>m</replaceable> </entry>
<entry> (where <replaceable>m</replaceable> is a nonzero digit)
a back reference to the <replaceable>m</replaceable>'th subexpression </entry>
</row>
<row>
<entry> <literal>\</literal><replaceable>mnn</replaceable> </entry>
<entry> (where <replaceable>m</replaceable> is a nonzero digit, and
<replaceable>nn</replaceable> is some more digits, and the decimal value
<replaceable>mnn</replaceable> is not greater than the number of closing capturing
parentheses seen so far)
a back reference to the <replaceable>mnn</replaceable>'th subexpression </entry>
</row>
</tbody>
</tgroup>
</table>
<note>
<para>
There is an