<literal>{</literal><replaceable>m</replaceable><literal>}?</literal> </entry>
<entry> non-greedy version of <literal>{</literal><replaceable>m</replaceable><literal>}</literal> </entry>
</row>
<row>
<entry> <literal>{</literal><replaceable>m</replaceable><literal>,}?</literal> </entry>
<entry> non-greedy version of <literal>{</literal><replaceable>m</replaceable><literal>,}</literal> </entry>
</row>
<row>
<entry>
<literal>{</literal><replaceable>m</replaceable><literal>,</literal><replaceable>n</replaceable><literal>}?</literal> </entry>
<entry> non-greedy version of <literal>{</literal><replaceable>m</replaceable><literal>,</literal><replaceable>n</replaceable><literal>}</literal> </entry>
</row>
</tbody>
</tgroup>
</table>
<para>
The forms using <literal>{</literal><replaceable>...</replaceable><literal>}</literal>
are known as <firstterm>bounds</firstterm>.
The numbers <replaceable>m</replaceable> and <replaceable>n</replaceable> within a bound are
unsigned decimal integers with permissible values from 0 to 255 inclusive.
</para>
<para>
<firstterm>Non-greedy</firstterm> quantifiers (available in AREs only) match the
same possibilities as their corresponding normal (<firstterm>greedy</firstterm>)
counterparts, but prefer the smallest number rather than the largest
number of matches.
See <xref linkend="posix-matching-rules"/> for more detail.
</para>
<note>
<para>
A quantifier cannot immediately follow another quantifier, e.g.,
<literal>**</literal> is invalid.
A quantifier cannot
begin an expression or subexpression or follow
<literal>^</literal> or <literal>|</literal>.
</para>
</note>
<table id="posix-constraints-table">
<title>Regular Expression Constraints</title>
<tgroup cols="2">
<thead>
<row>
<entry>Constraint</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>^</literal> </entry>
<entry> matches at the beginning of the string </entry>
</row>
<row>
<entry> <literal>$</literal> </entry>
<entry> matches at the end of the string </entry>
</row>
<row>
<entry> <literal>(?=</literal><replaceable>re</replaceable><literal>)</literal> </entry>
<entry> <firstterm>positive lookahead</firstterm> matches at any point
where a substring matching <replaceable>re</replaceable> begins
(AREs only) </entry>
</row>
<row>
<entry> <literal>(?!</literal><replaceable>re</replaceable><literal>)</literal> </entry>
<entry> <firstterm>negative lookahead</firstterm> matches at any point
where no substring matching <replaceable>re</replaceable> begins
(AREs only) </entry>
</row>
<row>
<entry> <literal>(?<=</literal><replaceable>re</replaceable><literal>)</literal> </entry>
<entry> <firstterm>positive lookbehind</firstterm> matches at any point
where a substring matching <replaceable>re</replaceable> ends
(AREs only) </entry>
</row>
<row>
<entry> <literal>(?<!</literal><replaceable>re</replaceable><literal>)</literal> </entry>
<entry> <firstterm>negative lookbehind</firstterm> matches at any point
where no substring matching <replaceable>re</replaceable> ends
(AREs only) </entry>
</row>
</tbody>
</tgroup>
</table>
<para>
Lookahead and lookbehind constraints cannot contain <firstterm>back
references</firstterm> (see <xref linkend="posix-escape-sequences"/>),
and all parentheses within them are considered non-capturing.
</para>
</sect3>
<sect3 id="posix-bracket-expressions">
<title>Bracket Expressions</title>
<para>
A <firstterm>bracket expression</firstterm> is a list of
characters enclosed