+Escapes (AREs only), which begin with a <tt>@\</tt> followed by an alphanumeric
+character, come in several varieties: character entry, class shorthands,
+constraint escapes, and back references. A <tt>@\</tt> followed by an
+alphanumeric character but not constituting a valid escape is illegal in AREs.
+In EREs, there are no escapes: outside a bracket expression, a <tt>@\</tt>
+followed by an alphanumeric character merely stands for that character as an
+ordinary character, and inside a bracket expression, <tt>@\</tt> is an ordinary
+character. (The latter is the one actual incompatibility between EREs and
+AREs.)
+
+Character-entry escapes (AREs only) exist to make it easier to specify
+non-printing and otherwise inconvenient characters in REs:
+
+@beginTable
+@row2col{ <tt>@\a</tt> , Alert (bell) character, as in C. }
+@row2col{ <tt>@\b</tt> , Backspace, as in C. }
+@row2col{ <tt>@\B</tt> ,
+ Synonym for <tt>@\</tt> to help reduce backslash doubling in some
+ applications where there are multiple levels of backslash processing. }
+@row2col{ <tt>@\cX</tt> ,
+ The character whose low-order 5 bits are the same as those of @e X, and
+ whose other bits are all zero, where @e X is any character. }
+@row2col{ <tt>@\e</tt> ,
+ The character whose collating-sequence name is @c ESC, or failing that,
+ the character with octal value 033. }
+@row2col{ <tt>@\f</tt> , Formfeed, as in C. }
+@row2col{ <tt>@\n</tt> , Newline, as in C. }
+@row2col{ <tt>@\r</tt> , Carriage return, as in C. }
+@row2col{ <tt>@\t</tt> , Horizontal tab, as in C. }
+@row2col{ <tt>@\uwxyz</tt> ,
+ The Unicode character <tt>U+wxyz</tt> in the local byte ordering, where
+ @e wxyz is exactly four hexadecimal digits. }
+@row2col{ <tt>@\Ustuvwxyz</tt> ,
+ Reserved for a somewhat-hypothetical Unicode extension to 32 bits, where
+ @e stuvwxyz is exactly eight hexadecimal digits. }
+@row2col{ <tt>@\v</tt> , Vertical tab, as in C are all available. }
+@row2col{ <tt>@\xhhh</tt> ,
+ The single character whose hexadecimal value is @e 0xhhh, where @e hhh is
+ any sequence of hexadecimal digits. }
+@row2col{ <tt>@\0</tt> , The character whose value is 0. }
+@row2col{ <tt>@\xy</tt> ,
+ The character whose octal value is @e 0xy, where @e xy is exactly two octal
+ digits, and is not a <em>back reference</em> (see below). }
+@row2col{ <tt>@\xyz</tt> ,
+ The character whose octal value is @e 0xyz, where @e xyz is exactly three
+ octal digits, and is not a <em>back reference</em> (see below). }
+@endTable
+
+Hexadecimal digits are 0-9, a-f, and A-F. Octal digits are 0-7.
+
+The character-entry escapes are always taken as ordinary characters. For
+example, <tt>@\135</tt> is <tt>]</tt> in ASCII, but <tt>@\135</tt> does not
+terminate a bracket expression. Beware, however, that some applications (e.g.,
+C compilers) interpret such sequences themselves before the regular-expression
+package gets to see them, which may require doubling (quadrupling, etc.) the
+'<tt>@\</tt>'.
+
+Class-shorthand escapes (AREs only) provide shorthands for certain
+commonly-used character classes:
+
+@beginTable
+@row2col{ <tt>@\d</tt> , <tt>[[:digit:]]</tt> }
+@row2col{ <tt>@\s</tt> , <tt>[[:space:]]</tt> }
+@row2col{ <tt>@\w</tt> , <tt>[[:alnum:]_]</tt> (note underscore) }
+@row2col{ <tt>@\D</tt> , <tt>[^[:digit:]]</tt> }
+@row2col{ <tt>@\S</tt> , <tt>[^[:space:]]</tt> }
+@row2col{ <tt>@\W</tt> , <tt>[^[:alnum:]_]</tt> (note underscore) }
+@endTable
+
+Within bracket expressions, <tt>@\d</tt>, <tt>@\s</tt>, and <tt>@\w</tt> lose
+their outer brackets, and <tt>@\D</tt>, <tt>@\S</tt>, <tt>@\W</tt> are illegal.
+So, for example, <tt>[a-c@\d]</tt> is equivalent to <tt>[a-c[:digit:]]</tt>.
+Also, <tt>[a-c@\D]</tt>, which is equivalent to <tt>[a-c^[:digit:]]</tt>, is
+illegal.
+
+A constraint escape (AREs only) is a constraint, matching the empty string if
+specific conditions are met, written as an escape:
+
+@beginTable
+@row2col{ <tt>@\A</tt> , Matches only at the beginning of the string, see
+ @ref overview_resyntax_matching for how this differs
+ from <tt>^</tt>. }
+@row2col{ <tt>@\m</tt> , Matches only at the beginning of a word. }
+@row2col{ <tt>@\M</tt> , Matches only at the end of a word. }
+@row2col{ <tt>@\y</tt> , Matches only at the beginning or end of a word. }
+@row2col{ <tt>@\Y</tt> , Matches only at a point that is not the beginning or
+ end of a word. }
+@row2col{ <tt>@\Z</tt> , Matches only at the end of the string, see
+ @ref overview_resyntax_matching for how this differs
+ from <tt>@$</tt>. }
+@row2col{ <tt>@\m</tt> , A <em>back reference</em>, where @e m is a non-zero
+ digit. See below. }
+@row2col{ <tt>@\mnn</tt> ,
+ A <em>back reference</em>, where @e m is a nonzero digit, and @e nn is some
+ more digits, and the decimal value @e mnn is not greater than the number of
+ closing capturing parentheses seen so far. See below. }
+@endTable
+
+A word is defined as in the specification of <tt>[[:@<:]]</tt> and
+<tt>[[:@>:]]</tt> above. Constraint escapes are illegal within bracket
+expressions.
+
+A back reference (AREs only) matches the same string matched by the
+parenthesized subexpression specified by the number. For example, "([bc])\1"
+matches "bb" or "cc" but not "bc". The subexpression must entirely precede the
+back reference in the RE.Subexpressions are numbered in the order of their
+leading parentheses. Non-capturing parentheses do not define subexpressions.
+
+There is an inherent historical ambiguity between octal character-entry escapes
+and back references, which is resolved by heuristics, as hinted at above. A
+leading zero always indicates an octal escape. A single non-zero digit, not
+followed by another digit, is always taken as a back reference. A multi-digit
+sequence not starting with a zero is taken as a back reference if it comes
+after a suitable subexpression (i.e. the number is in the legal range for a
+back reference), and otherwise is taken as octal.