doc: use ASCII in .texi files where UTF-8 isn't needed
[gnulib.git] / doc / regex.texi
index d93953e..9810092 100644 (file)
@@ -1,213 +1,4 @@
-\input texinfo
-@c %**start of header
-@setfilename regex.info
-@settitle Regex
-@c %**end of header
-
-@c \\{fill-paragraph} works better (for me, anyway) if the text in the
-@c source file isn't indented.
-@paragraphindent 2
-
-@c Define a new index for our magic constants.
-@defcodeindex cn
-
-@c Put everything in one index (arbitrarily chosen to be the concept index).
-@syncodeindex cn cp
-@syncodeindex ky cp
-@syncodeindex pg cp
-@syncodeindex tp cp
-@syncodeindex vr cp
-
-@c Here is what we use in the Info `dir' file:
-@c * Regex: (regex).    Regular expression library.
-
-
-@ifinfo
-This file documents the GNU regular expression library.
-
-Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries a copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end ifinfo
-
-
-@titlepage
-
-@title Regex
-@subtitle edition 0.12a
-@subtitle 19 September 1992
-@author Kathryn A. Hargreaves
-@author Karl Berry
-
-@page
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1992 Free Software Foundation.
-
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-
-@end titlepage
-
-
-@ifinfo
-@node Top, Overview, (dir), (dir)
-@top Regular Expression Library
-
-This manual documents how to program with the GNU regular expression
-library.  This is edition 0.12a of the manual, 19 September 1992.
-
-The first part of this master menu lists the major nodes in this Info
-document, including the index.  The rest of the menu lists all the
-lower level nodes in the document.
-
-@menu
-* Overview::
-* Regular Expression Syntax::
-* Common Operators::
-* GNU Operators::
-* GNU Emacs Operators::
-* What Gets Matched?::
-* Programming with Regex::
-* Copying::                     Copying and sharing Regex.
-* Index::                       General index.
- --- The Detailed Node Listing ---
-
-Regular Expression Syntax
-
-* Syntax Bits::
-* Predefined Syntaxes::
-* Collating Elements vs. Characters::
-* The Backslash Character::
-
-Common Operators
-
-* Match-self Operator::                 Ordinary characters.
-* Match-any-character Operator::        .
-* Concatenation Operator::              Juxtaposition.
-* Repetition Operators::                *  +  ? @{@}
-* Alternation Operator::                |
-* List Operators::                      [...]  [^...]
-* Grouping Operators::                  (...)
-* Back-reference Operator::             \digit
-* Anchoring Operators::                 ^  $
-
-Repetition Operators    
-
-* Match-zero-or-more Operator::  *
-* Match-one-or-more Operator::   +
-* Match-zero-or-one Operator::   ?
-* Interval Operators::           @{@}
-
-List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{} @code{]})
-
-* Character Class Operators::   [:class:]
-* Range Operator::          start-end
-
-Anchoring Operators    
-
-* Match-beginning-of-line Operator::  ^
-* Match-end-of-line Operator::        $
-
-GNU Operators
-
-* Word Operators::
-* Buffer Operators::
-
-Word Operators
-
-* Non-Emacs Syntax Tables::
-* Match-word-boundary Operator::        \b
-* Match-within-word Operator::          \B
-* Match-beginning-of-word Operator::    \<
-* Match-end-of-word Operator::          \>
-* Match-word-constituent Operator::     \w
-* Match-non-word-constituent Operator:: \W
-
-Buffer Operators    
-
-* Match-beginning-of-buffer Operator::  \`
-* Match-end-of-buffer Operator::        \'
-
-GNU Emacs Operators
-
-* Syntactic Class Operators::
-
-Syntactic Class Operators
-
-* Emacs Syntax Tables::
-* Match-syntactic-class Operator::      \sCLASS
-* Match-not-syntactic-class Operator::  \SCLASS
-
-Programming with Regex
-
-* GNU Regex Functions::
-* POSIX Regex Functions::
-* BSD Regex Functions::
-
-GNU Regex Functions
-
-* GNU Pattern Buffers::         The re_pattern_buffer type.
-* GNU Regular Expression Compiling::  re_compile_pattern ()
-* GNU Matching::                re_match ()
-* GNU Searching::               re_search ()
-* Matching/Searching with Split Data::  re_match_2 (), re_search_2 ()
-* Searching with Fastmaps::     re_compile_fastmap ()
-* GNU Translate Tables::        The `translate' field.
-* Using Registers::             The re_registers type and related fns.
-* Freeing GNU Pattern Buffers::  regfree ()
-
-POSIX Regex Functions
-
-* POSIX Pattern Buffers::               The regex_t type.
-* POSIX Regular Expression Compiling::  regcomp ()
-* POSIX Matching::                      regexec ()
-* Reporting Errors::                    regerror ()
-* Using Byte Offsets::                  The regmatch_t type.
-* Freeing POSIX Pattern Buffers::       regfree ()
-
-BSD Regex Functions
-
-* BSD Regular Expression Compiling::    re_comp ()
-* BSD Searching::                       re_exec ()
-@end menu
-@end ifinfo
-@node Overview, Regular Expression Syntax, Top, Top
+@node Overview
 @chapter Overview
 
 A @dfn{regular expression} (or @dfn{regexp}, or @dfn{pattern}) is a text
@@ -220,7 +11,7 @@ Using the Regex library, you can:
 @itemize @bullet
 
 @item
-see if a string matches a specified pattern as a whole, and 
+see if a string matches a specified pattern as a whole, and
 
 @item
 search within a string for a substring matching a specified pattern.
@@ -245,17 +36,13 @@ converted to the internal format used by the library functions.  Once
 you've compiled a pattern, you can use it for matching or searching any
 number of times.
 
-The Regex library consists of two source files: @file{regex.h} and
-@file{regex.c}.  
+The Regex library is used by including @file{regex.h}.
 @pindex regex.h
-@pindex regex.c
 Regex provides three groups of functions with which you can operate on
-regular expressions.  One group---the @sc{gnu} group---is more powerful
-but not completely compatible with the other two, namely the @sc{posix}
-and Berkeley @sc{unix} groups; its interface was designed specifically
-for @sc{gnu}.  The other groups have the same interfaces as do the
-regular expression functions in @sc{posix} and Berkeley
-@sc{unix}.
+regular expressions.  One group---the GNU group---is more
+powerful but not completely compatible with the other two, namely the
+POSIX and Berkeley Unix groups; its interface was designed
+specifically for GNU.
 
 We wrote this chapter with programmers in mind, not users of
 programs---such as Emacs---that use Regex.  We describe the Regex
@@ -263,7 +50,7 @@ library in its entirety, not how to write regular expressions that a
 particular program understands.
 
 
-@node Regular Expression Syntax, Common Operators, Overview, Top
+@node Regular Expression Syntax
 @chapter Regular Expression Syntax
 
 @cindex regular expressions, syntax of
@@ -301,28 +88,28 @@ In the following sections, we describe these things in more detail.
 @end menu
 
 
-@node Syntax Bits, Predefined Syntaxes,  , Regular Expression Syntax
-@section Syntax Bits 
+@node Syntax Bits
+@section Syntax Bits
 
 @cindex syntax bits
 
 In any particular syntax for regular expressions, some characters are
 always special, others are sometimes special, and others are never
 special.  The particular syntax that Regex recognizes for a given
-regular expression depends on the value in the @code{syntax} field of
-the pattern buffer of that regular expression.
+regular expression depends on the current syntax (as set by
+@code{re_set_syntax}) when the pattern buffer of that regular expression
+was compiled.
 
 You get a pattern buffer by compiling a regular expression.  @xref{GNU
-Pattern Buffers}, and @ref{POSIX Pattern Buffers}, for more information
-on pattern buffers.  @xref{GNU Regular Expression Compiling}, @ref{POSIX
+Pattern Buffers}, for more information on pattern buffers.  @xref{GNU
 Regular Expression Compiling}, and @ref{BSD Regular Expression
 Compiling}, for more information on compiling.
 
-Regex considers the value of the @code{syntax} field to be a collection
-of bits; we refer to these bits as @dfn{syntax bits}.  In most cases,
-they affect what characters represent what operators.  We describe the
-meanings of the operators to which we refer in @ref{Common Operators},
-@ref{GNU Operators}, and @ref{GNU Emacs Operators}.  
+Regex considers the current syntax to be a collection of bits; we refer
+to these bits as @dfn{syntax bits}.  In most cases, they affect what
+characters represent what operators.  We describe the meanings of the
+operators to which we refer in @ref{Common Operators}, @ref{GNU
+Operators}, and @ref{GNU Emacs Operators}.
 
 For reference, here is the complete list of syntax bits, in alphabetical
 order:
@@ -334,7 +121,7 @@ order:
 If this bit is set, then @samp{\} inside a list (@pxref{List Operators}
 quotes (makes ordinary, if it's special) the following character; if
 this bit isn't set, then @samp{\} is an ordinary character inside lists.
-(@xref{The Backslash Character}, for what `\' does outside of lists.)
+(@xref{The Backslash Character}, for what @samp{\} does outside of lists.)
 
 @cnindex RE_BK_PLUS_QM
 @item RE_BK_PLUS_QM
@@ -370,6 +157,12 @@ open-group or alternation operator.  The same holds for @samp{@{} (or
 it is the beginning of a valid interval and the syntax bit
 @code{RE_INTERVALS} is set.
 
+@cnindex RE_CONTEXT_INVALID_DUP
+@item RE_CONTEXT_INVALID_DUP
+If this bit is set, then an open-interval operator cannot occur at the
+start of a regular expression, or immediately after an alternation,
+open-group or close-interval operator.
+
 @cnindex RE_CONTEXT_INVALID_OPS
 @item RE_CONTEXT_INVALID_OPS
 If this bit is set, then repetition and alternation operators can't be
@@ -394,6 +187,12 @@ repetition and alternation characters anywhere in a regular expression.
 Whether or not they will in fact be operators in certain positions
 depends on other syntax bits.
 
+@cnindex RE_DEBUG
+@item RE_DEBUG
+If this bit is set, and the regex library was compiled with
+@code{-DDEBUG}, then internal debugging is turned on; if unset, then
+it is turned off.
+
 @cnindex RE_DOT_NEWLINE
 @item RE_DOT_NEWLINE
 If this bit is set, then the match-any-character operator matches
@@ -404,11 +203,27 @@ a newline; if this bit isn't set, then it doesn't.
 If this bit is set, then the match-any-character operator doesn't match
 a null character; if this bit isn't set, then it does.
 
+@cnindex RE_HAT_LISTS_NOT_NEWLINE
+@item RE_HAT_LISTS_NOT_NEWLINE
+If this bit is set, nonmatching lists @samp{[^...]} do not match
+newline; if not set, they do.
+
+@cnindex RE_ICASE
+@item RE_ICASE
+If this bit is set, then ignore case when matching; otherwise, case is
+significant.
+
 @cnindex RE_INTERVALS
 @item RE_INTERVALS
 If this bit is set, then Regex recognizes interval operators; if this bit
 isn't set, then it doesn't.
 
+@cnindex RE_INVALID_INTERVAL_ORD
+@item RE_INVALID_INTERVAL_ORD
+If this bit is set, a syntactically invalid interval is treated as a
+string of ordinary characters.  For example, the extended regular
+expression @samp{a@{1} is treated as @samp{a\@{1}.
+
 @cnindex RE_LIMITED_OPS
 @item RE_LIMITED_OPS
 If this bit is set, then Regex doesn't recognize the match-one-or-more,
@@ -452,6 +267,23 @@ If this bit is set, then a regular expression with a range whose ending
 point collates lower than its starting point is invalid; if this bit
 isn't set, then Regex considers such a range to be empty.
 
+@cnindex RE_NO_GNU_OPS
+@item RE_NO_GNU_OPS
+If this bit is set, GNU regex operators are not recognized; otherwise,
+they are.
+
+@cnindex RE_NO_POSIX_BACKTRACKING
+@item RE_NO_POSIX_BACKTRACKING
+If this bit is set, succeed as soon as we match the whole pattern,
+without further backtracking.  This means that a match may not be
+the leftmost longest; @pxref{What Gets Matched?} for what this means.
+
+@cnindex RE_NO_SUB
+@item RE_NO_SUB
+If this bit is set, then @code{no_sub} will be set to one during
+@code{re_compile_pattern}.  This causes matching and searching routines
+not to record substring match information.
+
 @cnindex RE_UNMATCHED_RIGHT_PAREN_ORD
 @item RE_UNMATCHED_RIGHT_PAREN_ORD
 If this bit is set and the regular expression has no matching open-group
@@ -461,29 +293,29 @@ operator (based on how @code{RE_NO_BK_PARENS} is set) to match @samp{)}.
 @end table
 
 
-@node Predefined Syntaxes, Collating Elements vs. Characters, Syntax Bits, Regular Expression Syntax
-@section Predefined Syntaxes    
+@node Predefined Syntaxes
+@section Predefined Syntaxes
 
 If you're programming with Regex, you can set a pattern buffer's
-(@pxref{GNU Pattern Buffers}, and @ref{POSIX Pattern Buffers})
-@code{syntax} field either to an arbitrary combination of syntax bits
+(@pxref{GNU Pattern Buffers})
+syntax either to an arbitrary combination of syntax bits
 (@pxref{Syntax Bits}) or else to the configurations defined by Regex.
 These configurations define the syntaxes used by certain
-programs---@sc{gnu} Emacs,
-@cindex Emacs 
-@sc{posix} Awk,
+programs---GNU Emacs,
+@cindex Emacs
+POSIX Awk,
 @cindex POSIX Awk
-traditional Awk, 
+traditional Awk,
 @cindex Awk
 Grep,
 @cindex Grep
 @cindex Egrep
-Egrep---in addition to syntaxes for @sc{posix} basic and extended
+Egrep---in addition to syntaxes for POSIX basic and extended
 regular expressions.
 
-The predefined syntaxes--taken directly from @file{regex.h}---are:
+The predefined syntaxes---taken directly from @file{regex.h}---are:
 
-@example
+@smallexample
 #define RE_SYNTAX_EMACS 0
 
 #define RE_SYNTAX_AWK                                                   \
@@ -541,12 +373,12 @@ The predefined syntaxes--taken directly from @file{regex.h}---are:
    | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES                           \
    | RE_NO_BK_PARENS        | RE_NO_BK_REFS                             \
    | RE_NO_BK_VBAR          | RE_UNMATCHED_RIGHT_PAREN_ORD)
-@end example
+@end smallexample
 
-@node Collating Elements vs. Characters, The Backslash Character, Predefined Syntaxes, Regular Expression Syntax
-@section Collating Elements vs.@: Characters    
+@node Collating Elements vs. Characters
+@section Collating Elements vs.@: Characters
 
-@sc{posix} generalizes the notion of a character to that of a
+POSIX generalizes the notion of a character to that of a
 collating element.  It defines a @dfn{collating element} to be ``a
 sequence of one or more bytes defined in the current collating sequence
 as a unit of collation.''
@@ -555,7 +387,7 @@ This generalizes the notion of a character in
 two ways.  First, a single character can map into two or more collating
 elements.  For example, the German
 @tex
-`\ss'
+``\ss''
 @end tex
 @ifinfo
 ``es-zet''
@@ -565,10 +397,10 @@ element @samp{s}.  Second, two or more characters can map into one
 collating element.  For example, the Spanish @samp{ll} collates after
 @samp{l} and before @samp{m}.
 
-Since @sc{posix}'s ``collating element'' preserves the essential idea of
+Since POSIX's ``collating element'' preserves the essential idea of
 a ``character,'' we use the latter, more familiar, term in this document.
 
-@node The Backslash Character,  , Collating Elements vs. Characters, Regular Expression Syntax
+@node The Backslash Character
 @section The Backslash Character
 
 @cindex \
@@ -659,12 +491,12 @@ In all other cases, Regex ignores @samp{\}.  For example,
 
 @end enumerate
 
-@node Common Operators, GNU Operators, Regular Expression Syntax, Top
+@node Common Operators
 @chapter Common Operators
 
 You compose regular expressions from operators.  In the following
 sections, we describe the regular expression operators specified by
-@sc{posix}; @sc{gnu} also uses these.  Most operators have more than one
+POSIX; GNU also uses these.  Most operators have more than one
 representation as characters.  @xref{Regular Expression Syntax}, for
 what characters represent what operators under what circumstances.
 
@@ -674,7 +506,7 @@ preceded by @samp{\}.  For example, either @samp{(} or @samp{\(}
 represents the open-group operator.  Which one does depends on the
 setting of a syntax bit, in this case @code{RE_NO_BK_PARENS}.  Why is
 this so?  Historical reasons dictate some of the varying
-representations, while @sc{posix} dictates others.  
+representations, while POSIX dictates others.
 
 Finally, almost all characters lose any special meaning inside a list
 (@pxref{List Operators}).
@@ -691,7 +523,7 @@ Finally, almost all characters lose any special meaning inside a list
 * Anchoring Operators::                 ^  $
 @end menu
 
-@node Match-self Operator, Match-any-character Operator,  , Common Operators
+@node Match-self Operator
 @section The Match-self Operator (@var{ordinary character})
 
 This operator matches the character itself.  All ordinary characters
@@ -700,7 +532,7 @@ example, @samp{f} is always an ordinary character, so the regular
 expression @samp{f} matches only the string @samp{f}.  In
 particular, it does @emph{not} match the string @samp{ff}.
 
-@node Match-any-character Operator, Concatenation Operator, Match-self Operator, Common Operators
+@node Match-any-character Operator
 @section The Match-any-character Operator (@code{.})
 
 @cindex @samp{.}
@@ -721,7 +553,7 @@ The @samp{.} (period) character represents this operator.  For example,
 @samp{a.b} matches any three-character string beginning with @samp{a}
 and ending with @samp{b}.
 
-@node Concatenation Operator, Repetition Operators, Match-any-character Operator, Common Operators
+@node Concatenation Operator
 @section The Concatenation Operator
 
 This operator concatenates two regular expressions @var{a} and @var{b}.
@@ -730,8 +562,8 @@ No character represents this operator; you simply put @var{b} after
 @var{a} matches its first part and @var{b} matches the rest.  For
 example, @samp{xy} (two match-self operators) matches @samp{xy}.
 
-@node Repetition Operators, Alternation Operator, Concatenation Operator, Common Operators
-@section Repetition Operators    
+@node Repetition Operators
+@section Repetition Operators
 
 Repetition operators repeat the preceding regular expression a specified
 number of times.
@@ -743,7 +575,7 @@ number of times.
 * Interval Operators::           @{@}
 @end menu
 
-@node Match-zero-or-more Operator, Match-one-or-more Operator,  , Repetition Operators
+@node Match-zero-or-more Operator
 @subsection The Match-zero-or-more Operator (@code{*})
 
 @cindex @samp{*}
@@ -761,10 +593,10 @@ useless as such when no regular expression precedes it.  This is the
 case when it:
 
 @itemize @bullet
-@item 
+@item
 is first in a regular expression, or
 
-@item 
+@item
 follows a match-beginning-of-line, open-group, or alternation
 operator.
 
@@ -791,7 +623,7 @@ Otherwise, @samp{*} is ordinary.
 @cindex backtracking
 The matcher processes a match-zero-or-more operator by first matching as
 many repetitions of the smallest preceding regular expression as it can.
-Then it continues to match the rest of the pattern.  
+Then it continues to match the rest of the pattern.
 
 If it can't match the rest of the pattern, it backtracks (as many times
 as necessary), each time discarding one of the matches until it can
@@ -804,10 +636,10 @@ the string.  So it backtracks, discarding the match of the last @samp{a}
 in the string.  It can then match the remaining @samp{ar}.
 
 
-@node Match-one-or-more Operator, Match-zero-or-one Operator, Match-zero-or-more Operator, Repetition Operators
+@node Match-one-or-more Operator
 @subsection The Match-one-or-more Operator (@code{+} or @code{\+})
 
-@cindex @samp{+} 
+@cindex @samp{+}
 
 If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't recognize
 this operator.  Otherwise, if the syntax bit @code{RE_BK_PLUS_QM} isn't
@@ -823,7 +655,7 @@ For example, supposing that @samp{+} represents the match-one-or-more
 operator; then @samp{ca+r} matches, e.g., @samp{car} and
 @samp{caaaar}, but not @samp{cr}.
 
-@node Match-zero-or-one Operator, Interval Operators, Match-one-or-more Operator, Repetition Operators
+@node Match-zero-or-one Operator
 @subsection The Match-zero-or-one Operator (@code{?} or @code{\?})
 @cindex @samp{?}
 
@@ -841,7 +673,7 @@ For example, supposing that @samp{?} represents the match-zero-or-one
 operator; then @samp{ca?r} matches both @samp{car} and @samp{cr}, but
 nothing else.
 
-@node Interval Operators,  , Match-zero-or-one Operator, Repetition Operators
+@node Interval Operators
 @subsection Interval Operators (@code{@{} @dots{} @code{@}} or @code{\@{} @dots{} @code{\@}})
 
 @cindex interval expression
@@ -866,11 +698,11 @@ open-interval and close-interval operators; then:
 matches exactly @var{count} occurrences of the preceding regular
 expression.
 
-@item @{@var{min,}@}
+@item @{@var{min},@}
 matches @var{min} or more occurrences of the preceding regular
 expression.
 
-@item  @{@var{minmax}@}
+@item  @{@var{min}, @var{max}@}
 matches at least @var{min} but no more than @var{max} occurrences of
 the preceding regular expression.
 
@@ -881,7 +713,7 @@ contains it) is invalid if:
 
 @itemize @bullet
 @item
-@var{min} is greater than @var{max}, or 
+@var{min} is greater than @var{max}, or
 
 @item
 any of @var{count}, @var{min}, or @var{max} are outside the range
@@ -903,7 +735,7 @@ than backslashes, which it ignores---in the would-be interval to be
 ordinary.
 
 
-@node Alternation Operator, List Operators, Repetition Operators, Common Operators
+@node Alternation Operator
 @section The Alternation Operator (@code{|} or @code{\|})
 
 @kindex |
@@ -924,32 +756,6 @@ example, supposing that @samp{|} is the alternation operator, then
 @samp{foo|bar|quux} would match any of @samp{foo}, @samp{bar} or
 @samp{quux}.
 
-@ignore
-@c Nobody needs to disallow empty alternatives any more.
-If the syntax bit @code{RE_NO_EMPTY_ALTS} is set, then if either of the regular
-expressions @var{a} or @var{b} is empty, the
-regular expression is invalid.  More precisely, if this syntax bit is
-set, then the alternation operator can't:
-
-@itemize @bullet
-@item
-be first or last in a regular expression;
-
-@item
-follow either another alternation operator or an open-group operator
-(@pxref{Grouping Operators}); or
-
-@item
-precede a close-group operator.
-
-@end itemize
-
-@noindent
-For example, supposing @samp{(} and @samp{)} represent the open and
-close-group operators, then @samp{|foo}, @samp{foo|}, @samp{foo||bar},
-@samp{foo(|bar)}, and @samp{(foo|)bar} would all be invalid.
-@end ignore
-
 The alternation operator operates on the @emph{largest} possible
 surrounding regular expressions.  (Put another way, it has the lowest
 precedence of any regular expression operator.)
@@ -960,16 +766,19 @@ would match either @samp{fooar} or @samp{fobar}.  (@samp{foo|bar} would
 match @samp{foo} or @samp{bar}.)
 
 @cindex backtracking
-The matcher usually tries all combinations of alternatives so as to 
+The matcher usually tries all combinations of alternatives so as to
 match the longest possible string.  For example, when matching
 @samp{(fooq|foo)*(qbarquux|bar)} against @samp{fooqbarquux}, it cannot
 take, say, the first (``depth-first'') combination it could match, since
-then it would be content to match just @samp{fooqbar}.  
+then it would be content to match just @samp{fooqbar}.
 
-@comment xx something about leftmost-longest
+Note that since the default behavior is to return the leftmost longest
+match, when more than one of a series of alternatives matches the actual
+match will be the longest matching alternative, not necessarily the
+first in the list.
 
 
-@node List Operators, Grouping Operators, Alternation Operator, Common Operators
+@node List Operators
 @section List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{} @code{]})
 
 @cindex matching list
@@ -985,18 +794,15 @@ then it would be content to match just @samp{fooqbar}.
 
 @dfn{Lists}, also called @dfn{bracket expressions}, are a set of one or
 more items.  An @dfn{item} is a character,
-@ignore
-(These get added when they get implemented.)
-a collating symbol, an equivalence class expression, 
-@end ignore
+a collating symbol, an equivalence class expression,
 a character class expression, or a range expression.  The syntax bits
 affect which kinds of items you can put in a list.  We explain the last
-two items in subsections below.  Empty lists are invalid.
+four items in subsections below.  Empty lists are invalid.
 
 A @dfn{matching list} matches a single character represented by one of
 the list items.  You form a matching list by enclosing one or more items
 within an @dfn{open-matching-list operator} (represented by @samp{[})
-and a @dfn{close-list operator} (represented by @samp{]}).  
+and a @dfn{close-list operator} (represented by @samp{]}).
 
 For example, @samp{[ab]} matches either @samp{a} or @samp{b}.
 @samp{[ad]*} matches the empty string and any string composed of just
@@ -1011,13 +817,13 @@ items.  You use an @dfn{open-nonmatching-list operator} (represented by
 the first character in the list.  If you put a @samp{^} character first
 in (what you think is) a matching list, you'll turn it into a
 nonmatching list.}) instead of an open-matching-list operator to start a
-nonmatching list.  
+nonmatching list.
 
 For example, @samp{[^ab]} matches any character except @samp{a} or
-@samp{b}.  
+@samp{b}.
 
-If the @code{posix_newline} field in the pattern buffer (@pxref{GNU
-Pattern Buffers} is set, then nonmatching lists do not match a newline.
+If the syntax bit @code{RE_HAT_LISTS_NOT_NEWLINE} is set, then
+nonmatching lists do not match a newline.
 
 Most characters lose any special meaning inside a list.  The special
 characters inside a list follow.
@@ -1031,9 +837,6 @@ the @samp{]} character a list item, you must put it first.
 quotes the next character if the syntax bit @code{RE_BACKSLASH_ESCAPE_IN_LISTS} is
 set.
 
-@ignore
-Put these in if they get implemented.
-
 @item [.
 represents the open-collating-symbol operator (@pxref{Collating Symbol
 Operators}).
@@ -1048,8 +851,6 @@ Operators}).
 @item =]
 represents the close-equivalence-class operator.
 
-@end ignore
-
 @item [:
 represents the open-character-class operator (@pxref{Character Class
 Operators}) if the syntax bit @code{RE_CHAR_CLASSES} is set and what
@@ -1060,43 +861,42 @@ represents the close-character-class operator if the syntax bit
 @code{RE_CHAR_CLASSES} is set and what precedes it is an
 open-character-class operator followed by a valid character class name.
 
-@item - 
+@item -
 represents the range operator (@pxref{Range Operator}) if it's
 not first or last in a list or the ending point of a range.
 
 @end table
 
 @noindent
-All other characters are ordinary.  For example, @samp{[.*]} matches 
-@samp{.} and @samp{*}.  
+All other characters are ordinary.  For example, @samp{[.*]} matches
+@samp{.} and @samp{*}.
 
 @menu
+* Collating Symbol Operators::  [.elem.]
+* Equivalence Class Operators:: [=class=]
 * Character Class Operators::   [:class:]
 * Range Operator::          start-end
 @end menu
 
-@ignore
-(If collating symbols and equivalence class expressions get implemented,
-then add this.)
 
-node Collating Symbol Operators
-subsubsection Collating Symbol Operators (@code{[.} @dots{} @code{.]})
+@node Collating Symbol Operators
+@subsection Collating Symbol Operators (@code{[.} @dots{} @code{.]})
 
-If the syntax bit @code{XX} is set, then you can represent
-collating symbols inside lists.  You form a @dfn{collating symbol} by
+Collating symbols can be represented inside lists.
+You form a @dfn{collating symbol} by
 putting a collating element between an @dfn{open-collating-symbol
-operator} and an @dfn{close-collating-symbol operator}.  @samp{[.}
+operator} and a @dfn{close-collating-symbol operator}.  @samp{[.}
 represents the open-collating-symbol operator and @samp{.]} represents
 the close-collating-symbol operator.  For example, if @samp{ll} is a
 collating element, then @samp{[[.ll.]]} would match @samp{ll}.
 
-node Equivalence Class Operators
-subsubsection Equivalence Class Operators (@code{[=} @dots{} @code{=]})
+@node Equivalence Class Operators
+@subsection Equivalence Class Operators (@code{[=} @dots{} @code{=]})
 @cindex equivalence class expression in regex
 @cindex @samp{[=} in regex
 @cindex @samp{=]} in regex
 
-If the syntax bit @code{XX} is set, then Regex recognizes equivalence class
+Regex recognizes equivalence class
 expressions inside lists.  A @dfn{equivalence class expression} is a set
 of collating elements which all belong to the same equivalence class.
 You form an equivalence class expression by putting a collating
@@ -1110,36 +910,34 @@ equivalence class expression isn't part of an equivalence class, then
 the matcher considers the equivalence class expression to be a collating
 symbol.
 
-@end ignore
-
-@node Character Class Operators, Range Operator,  , List Operators
+@node Character Class Operators
 @subsection Character Class Operators (@code{[:} @dots{} @code{:]})
 
 @cindex character classes
-@cindex @samp{[:} in regex
-@cindex @samp{:]} in regex
+@cindex @samp{[colon} in regex
+@cindex @samp{colon]} in regex
 
-If the syntax bit @code{RE_CHARACTER_CLASSES} is set, then Regex
-recognizes character class expressions inside lists.  A @dfn{character
-class expression} matches one character from a given class.  You form a
-character class expression by putting a character class name between an
-@dfn{open-character-class operator} (represented by @samp{[:}) and a
-@dfn{close-character-class operator} (represented by @samp{:]}).  The
-character class names and their meanings are:
+If the syntax bit @code{RE_CHAR_CLASSES} is set, then Regex recognizes
+character class expressions inside lists.  A @dfn{character class
+expression} matches one character from a given class.  You form a
+character class expression by putting a character class name between
+an @dfn{open-character-class operator} (represented by @samp{[:}) and
+a @dfn{close-character-class operator} (represented by @samp{:]}).
+The character class names and their meanings are:
 
 @table @code
 
-@item alnum 
+@item alnum
 letters and digits
 
 @item alpha
 letters
 
 @item blank
-system-dependent; for @sc{gnu}, a space or tab
+system-dependent; for GNU, a space or tab
 
 @item cntrl
-control characters (in the @sc{ascii} encoding, code 0177 and codes
+control characters (in the ASCII encoding, code 0177 and codes
 less than 040)
 
 @item digit
@@ -1148,11 +946,11 @@ digits
 @item graph
 same as @code{print} except omits space
 
-@item lower 
+@item lower
 lowercase letters
 
 @item print
-printable characters (in the @sc{ascii} encoding, space 
+printable characters (in the ASCII encoding, space
 tilde---codes 040 through 0176)
 
 @item punct
@@ -1177,24 +975,20 @@ only inside of lists; so @samp{[[:alpha:]]} matches any letter, but
 @samp{[:alpha:]} outside of a bracket expression and not followed by a
 repetition operator matches just itself.
 
-@node Range Operator,  , Character Class Operators, List Operators
+@node Range Operator
 @subsection The Range Operator (@code{-})
 
 Regex recognizes @dfn{range expressions} inside a list. They represent
 those characters
 that fall between two elements in the current collating sequence.  You
-form a range expression by putting a @dfn{range operator} between two 
-@ignore
-(If these get implemented, then substitute this for ``characters.'')
+form a range expression by putting a @dfn{range operator} between two
 of any of the following: characters, collating elements, collating symbols,
 and equivalence class expressions.  The starting point of the range and
 the ending point of the range don't have to be the same kind of item,
 e.g., the starting point could be a collating element and the ending
 point could be an equivalence class expression.  If a range's ending
 point is an equivalence class, then all the collating elements in that
-class will be in the range.
-@end ignore
-characters.@footnote{You can't use a character class for the starting
+class will be in the range.@footnote{You can't use a character class for the starting
 or ending point of a range, since a character class is not a single
 character.} @samp{-} represents the range operator.  For example,
 @samp{a-f} within a list represents all the characters from @samp{a}
@@ -1221,7 +1015,7 @@ Include a range whose starting point collates strictly lower than
 range is the first item in a list, a @samp{-} can't be its starting
 point, but @emph{can} be its ending point.  That is because Regex
 considers @samp{-} to be the range operator unless it is preceded by
-another @samp{-}.  For example, in the @sc{ascii} encoding, @samp{)},
+another @samp{-}.  For example, in the ASCII encoding, @samp{)},
 @samp{*}, @samp{+}, @samp{,}, @samp{-}, @samp{.}, and @samp{/} are
 contiguous characters in the collating sequence.  You might think that
 @samp{[)-+--/]} has two ranges: @samp{)-+} and @samp{--/}.  Rather, it
@@ -1234,10 +1028,10 @@ Put a range whose starting point is @samp{-} first in the list.
 @end itemize
 
 For example, @samp{[-a-z]} matches a lowercase letter or a hyphen (in
-English, in @sc{ascii}).
+English, in ASCII).
 
 
-@node Grouping Operators, Back-reference Operator, List Operators, Common Operators
+@node Grouping Operators
 @section Grouping Operators (@code{(} @dots{} @code{)} or @code{\(} @dots{} @code{\)})
 
 @kindex (
@@ -1262,7 +1056,7 @@ delimit the argument(s) to an alternation operator (@pxref{Alternation
 Operator}) or a repetition operator (@pxref{Repetition
 Operators}).
 
-@item 
+@item
 keep track of the indices of the substring that matched a given group.
 @xref{Using Registers}, for a precise explanation.
 This lets you:
@@ -1271,7 +1065,7 @@ This lets you:
 @item
 use the back-reference operator (@pxref{Back-reference Operator}).
 
-@item 
+@item
 use registers (@pxref{Using Registers}).
 
 @end itemize
@@ -1287,7 +1081,7 @@ close-group operator has no matching open-group operator, then Regex
 considers it to match @samp{)}.
 
 
-@node Back-reference Operator, Anchoring Operators, Grouping Operators, Common Operators
+@node Back-reference Operator
 @section The Back-reference Operator (@dfn{\}@var{digit})
 
 @cindex back references
@@ -1351,8 +1145,8 @@ If there is no preceding @w{@var{digit}-th} subexpression, the regular
 expression is invalid.
 
 
-@node Anchoring Operators,  , Back-reference Operator, Common Operators
-@section Anchoring Operators    
+@node Anchoring Operators
+@section Anchoring Operators
 
 @cindex anchoring
 @cindex regexp anchoring
@@ -1366,7 +1160,7 @@ end of the entire string or at the beginning or end of a line.
 @end menu
 
 
-@node Match-beginning-of-line Operator, Match-end-of-line Operator,  , Anchoring Operators
+@node Match-beginning-of-line Operator
 @subsection The Match-beginning-of-line Operator (@code{^})
 
 @kindex ^
@@ -1406,15 +1200,13 @@ is set.
 @vindex not_bol @r{field in pattern buffer}
 If the @code{not_bol} field is set in the pattern buffer (@pxref{GNU
 Pattern Buffers}), then @samp{^} fails to match at the beginning of the
-string.  @xref{POSIX Matching}, for when you might find this useful.
-
-@vindex newline_anchor @r{field in pattern buffer}
-If the @code{newline_anchor} field is set in the pattern buffer, then
-@samp{^} fails to match after a newline.  This is useful when you do not
-regard the string to be matched as broken into lines.
+string.  This lets you match against pieces of a line, as you would need to if,
+say, searching for repeated instances of a given pattern in a line; it
+would work correctly for patterns both with and without
+match-beginning-of-line operators.
 
 
-@node Match-end-of-line Operator,  , Match-beginning-of-line Operator, Anchoring Operators
+@node Match-end-of-line Operator
 @subsection The Match-end-of-line Operator (@code{$})
 
 @kindex $
@@ -1431,21 +1223,22 @@ matches, e.g., @samp{foo} and, e.g., the first three characters of
 
 Its interaction with the syntax bits and pattern buffer fields is
 exactly the dual of @samp{^}'s; see the previous section.  (That is,
-``beginning'' becomes ``end'', ``next'' becomes ``previous'', and
-``after'' becomes ``before''.)
+``@samp{^}'' becomes ``@samp{$}'', ``beginning'' becomes ``end'',
+``next'' becomes ``previous'', ``after'' becomes ``before'', and
+``@code{not_bol}'' becomes ``@code{not_eol}''.)
 
 
-@node GNU Operators, GNU Emacs Operators, Common Operators, Top
+@node GNU Operators
 @chapter GNU Operators
 
-Following are operators that @sc{gnu} defines (and @sc{posix} doesn't).
+Following are operators that GNU defines (and POSIX doesn't).
 
 @menu
 * Word Operators::
 * Buffer Operators::
 @end menu
 
-@node Word Operators, Buffer Operators,  , GNU Operators
+@node Word Operators
 @section Word Operators
 
 The operators in this section require Regex to recognize parts of words.
@@ -1462,11 +1255,11 @@ part of a word, i.e., whether or not it is @dfn{word-constituent}.
 * Match-non-word-constituent Operator:: \W
 @end menu
 
-@node Non-Emacs Syntax Tables, Match-word-boundary Operator,  , Word Operators
-@subsection Non-Emacs Syntax Tables    
+@node Non-Emacs Syntax Tables
+@subsection Non-Emacs Syntax Tables
 
 A @dfn{syntax table} is an array indexed by the characters in your
-character set.  In the @sc{ascii} encoding, therefore, a syntax table
+character set.  In the ASCII encoding, therefore, a syntax table
 has 256 elements.  Regex always uses a @code{char *} variable
 @code{re_syntax_table} as its syntax table.  In some cases, it
 initializes this variable and in others it expects you to initialize it.
@@ -1490,7 +1283,7 @@ the preprocessor symbol @code{emacs} defined.
 
 @end itemize
 
-@node Match-word-boundary Operator, Match-within-word Operator, Non-Emacs Syntax Tables, Word Operators
+@node Match-word-boundary Operator
 @subsection The Match-word-boundary Operator (@code{\b})
 
 @cindex @samp{\b}
@@ -1500,7 +1293,7 @@ This operator (represented by @samp{\b}) matches the empty string at
 either the beginning or the end of a word.  For example, @samp{\brat\b}
 matches the separate word @samp{rat}.
 
-@node Match-within-word Operator, Match-beginning-of-word Operator, Match-word-boundary Operator, Word Operators
+@node Match-within-word Operator
 @subsection The Match-within-word Operator (@code{\B})
 
 @cindex @samp{\B}
@@ -1509,7 +1302,7 @@ This operator (represented by @samp{\B}) matches the empty string within
 a word. For example, @samp{c\Brat\Be} matches @samp{crate}, but
 @samp{dirty \Brat} doesn't match @samp{dirty rat}.
 
-@node Match-beginning-of-word Operator, Match-end-of-word Operator, Match-within-word Operator, Word Operators
+@node Match-beginning-of-word Operator
 @subsection The Match-beginning-of-word Operator (@code{\<})
 
 @cindex @samp{\<}
@@ -1517,7 +1310,7 @@ a word. For example, @samp{c\Brat\Be} matches @samp{crate}, but
 This operator (represented by @samp{\<}) matches the empty string at the
 beginning of a word.
 
-@node Match-end-of-word Operator, Match-word-constituent Operator, Match-beginning-of-word Operator, Word Operators
+@node Match-end-of-word Operator
 @subsection The Match-end-of-word Operator (@code{\>})
 
 @cindex @samp{\>}
@@ -1525,7 +1318,7 @@ beginning of a word.
 This operator (represented by @samp{\>}) matches the empty string at the
 end of a word.
 
-@node Match-word-constituent Operator, Match-non-word-constituent Operator, Match-end-of-word Operator, Word Operators
+@node Match-word-constituent Operator
 @subsection The Match-word-constituent Operator (@code{\w})
 
 @cindex @samp{\w}
@@ -1533,7 +1326,7 @@ end of a word.
 This operator (represented by @samp{\w}) matches any word-constituent
 character.
 
-@node Match-non-word-constituent Operator,  , Match-word-constituent Operator, Word Operators
+@node Match-non-word-constituent Operator
 @subsection The Match-non-word-constituent Operator (@code{\W})
 
 @cindex @samp{\W}
@@ -1542,8 +1335,8 @@ This operator (represented by @samp{\W}) matches any character that is
 not word-constituent.
 
 
-@node Buffer Operators,  , Word Operators, GNU Operators
-@section Buffer Operators    
+@node Buffer Operators
+@section Buffer Operators
 
 Following are operators which work on buffers.  In Emacs, a @dfn{buffer}
 is, naturally, an Emacs buffer.  For other programs, Regex considers the
@@ -1555,7 +1348,7 @@ entire string to be matched as the buffer.
 @end menu
 
 
-@node Match-beginning-of-buffer Operator, Match-end-of-buffer Operator,  , Buffer Operators
+@node Match-beginning-of-buffer Operator
 @subsection The Match-beginning-of-buffer Operator (@code{\`})
 
 @cindex @samp{\`}
@@ -1563,7 +1356,7 @@ entire string to be matched as the buffer.
 This operator (represented by @samp{\`}) matches the empty string at the
 beginning of the buffer.
 
-@node Match-end-of-buffer Operator,  , Match-beginning-of-buffer Operator, Buffer Operators
+@node Match-end-of-buffer Operator
 @subsection The Match-end-of-buffer Operator (@code{\'})
 
 @cindex @samp{\'}
@@ -1572,19 +1365,19 @@ This operator (represented by @samp{\'}) matches the empty string at the
 end of the buffer.
 
 
-@node GNU Emacs Operators, What Gets Matched?, GNU Operators, Top
+@node GNU Emacs Operators
 @chapter GNU Emacs Operators
 
-Following are operators that @sc{gnu} defines (and @sc{posix} doesn't)
+Following are operators that GNU defines (and POSIX doesn't)
 that you can use only when Regex is compiled with the preprocessor
-symbol @code{emacs} defined.  
+symbol @code{emacs} defined.
 
 @menu
 * Syntactic Class Operators::
 @end menu
 
 
-@node Syntactic Class Operators,  ,  , GNU Emacs Operators
+@node Syntactic Class Operators
 @section Syntactic Class Operators
 
 The operators in this section require Regex to recognize the syntactic
@@ -1596,11 +1389,11 @@ classes of characters.  Regex uses a syntax table to determine this.
 * Match-not-syntactic-class Operator::  \SCLASS
 @end menu
 
-@node Emacs Syntax Tables, Match-syntactic-class Operator,  , Syntactic Class Operators
+@node Emacs Syntax Tables
 @subsection Emacs Syntax Tables
 
 A @dfn{syntax table} is an array indexed by the characters in your
-character set.  In the @sc{ascii} encoding, therefore, a syntax table
+character set.  In the ASCII encoding, therefore, a syntax table
 has 256 elements.
 
 If Regex is compiled with the preprocessor symbol @code{emacs} defined,
@@ -1610,7 +1403,7 @@ tables are more complicated than Regex's own (@pxref{Non-Emacs Syntax
 Tables}).  @xref{Syntax, , Syntax, emacs, The GNU Emacs User's Manual},
 for a description of Emacs' syntax tables.
 
-@node Match-syntactic-class Operator, Match-not-syntactic-class Operator, Emacs Syntax Tables, Syntactic Class Operators
+@node Match-syntactic-class Operator
 @subsection The Match-syntactic-class Operator (@code{\s}@var{class})
 
 @cindex @samp{\s}
@@ -1622,7 +1415,7 @@ want.  For example, @samp{w} represents the syntactic
 class of word-constituent characters, so @samp{\sw} matches any
 word-constituent character.
 
-@node Match-not-syntactic-class Operator,  , Match-syntactic-class Operator, Syntactic Class Operators
+@node Match-not-syntactic-class Operator
 @subsection The Match-not-syntactic-class Operator (@code{\S}@var{class})
 
 @cindex @samp{\S}
@@ -1635,7 +1428,7 @@ word-constituent characters, so @samp{\Sw} matches any character that is
 not word-constituent.
 
 
-@node What Gets Matched?, Programming with Regex, GNU Emacs Operators, Top
+@node What Gets Matched?
 @chapter What Gets Matched?
 
 Regex usually matches strings according to the ``leftmost longest''
@@ -1649,25 +1442,29 @@ For example, @samp{(ac*)(c*d[ac]*)\1} matches @samp{acdacaaa}, not
 first subexpression.
 
 
-@node Programming with Regex, Copying, What Gets Matched?, Top
+@node Programming with Regex
 @chapter Programming with Regex
 
 Here we describe how you use the Regex data structures and functions in
-C programs.  Regex has three interfaces: one designed for @sc{gnu}, one
-compatible with @sc{posix} and one compatible with Berkeley @sc{unix}.
+C programs.  Regex has three interfaces: one designed for GNU, one
+compatible with POSIX (as specified by POSIX, draft
+1003.2/D11.2), and one compatible with Berkeley Unix.  The
+POSIX interface is not documented here; see the documentation of
+GNU libc, or the POSIX man pages.  The Berkeley Unix interface is
+documented here for convenience, since its documentation is not
+otherwise readily available on GNU systems.
 
 @menu
 * GNU Regex Functions::
-* POSIX Regex Functions::
 * BSD Regex Functions::
 @end menu
 
 
-@node GNU Regex Functions, POSIX Regex Functions,  , Programming with Regex
+@node GNU Regex Functions
 @section GNU Regex Functions
 
 If you're writing code that doesn't need to be compatible with either
-@sc{posix} or Berkeley @sc{unix}, you can use these functions.  They
+POSIX or Berkeley Unix, you can use these functions.  They
 provide more options than the other interfaces.
 
 @menu
@@ -1677,13 +1474,13 @@ provide more options than the other interfaces.
 * GNU Searching::               re_search ()
 * Matching/Searching with Split Data::  re_match_2 (), re_search_2 ()
 * Searching with Fastmaps::     re_compile_fastmap ()
-* GNU Translate Tables::        The `translate' field.
+* GNU Translate Tables::        The @code{translate} field.
 * Using Registers::             The re_registers type and related fns.
 * Freeing GNU Pattern Buffers::  regfree ()
 @end menu
 
 
-@node GNU Pattern Buffers, GNU Regular Expression Compiling,  , GNU Regex Functions
+@node GNU Pattern Buffers
 @subsection GNU Pattern Buffers
 
 @cindex pattern buffer, definition of
@@ -1698,89 +1495,35 @@ regular expression.@footnote{Regular expressions are also referred to as
 You can have several different pattern buffers simultaneously, each
 holding a compiled pattern for a different regular expression.
 
-@file{regex.h} defines the pattern buffer @code{struct} as follows:
+@file{regex.h} defines the pattern buffer @code{struct} with the
+following public fields:
 
 @example
-        /* Space that holds the compiled pattern.  It is declared as
-          `unsigned char *' because its elements are
-           sometimes used as array indexes.  */
   unsigned char *buffer;
-
-        /* Number of bytes to which `buffer' points.  */
   unsigned long allocated;
-
-        /* Number of bytes actually used in `buffer'.  */
-  unsigned long used;   
-
-        /* Syntax setting with which the pattern was compiled.  */
-  reg_syntax_t syntax;
-
-        /* Pointer to a fastmap, if any, otherwise zero.  re_search uses
-           the fastmap, if there is one, to skip over impossible
-           starting points for matches.  */
   char *fastmap;
-
-        /* Either a translate table to apply to all characters before
-           comparing them, or zero for no translation.  The translation
-           is applied to a pattern when it is compiled and to a string
-           when it is matched.  */
   char *translate;
-
-        /* Number of subexpressions found by the compiler.  */
   size_t re_nsub;
-
-        /* Zero if this pattern cannot match the empty string, one else.
-           Well, in truth it's used only in `re_search_2', to see
-           whether or not we should use the fastmap, so we don't set
-           this absolutely perfectly; see `re_compile_fastmap' (the
-           `duplicate' case).  */
-  unsigned can_be_null : 1;
-
-        /* If REGS_UNALLOCATED, allocate space in the `regs' structure
-             for `max (RE_NREGS, re_nsub + 1)' groups.
-           If REGS_REALLOCATE, reallocate space if necessary.
-           If REGS_FIXED, use what's there.  */
-#define REGS_UNALLOCATED 0
-#define REGS_REALLOCATE 1
-#define REGS_FIXED 2
-  unsigned regs_allocated : 2;
-
-        /* Set to zero when `regex_compile' compiles a pattern; set to one
-           by `re_compile_fastmap' if it updates the fastmap.  */
-  unsigned fastmap_accurate : 1;
-
-        /* If set, `re_match_2' does not return information about
-           subexpressions.  */
   unsigned no_sub : 1;
-
-        /* If set, a beginning-of-line anchor doesn't match at the
-           beginning of the string.  */ 
   unsigned not_bol : 1;
-
-        /* Similarly for an end-of-line anchor.  */
   unsigned not_eol : 1;
-
-        /* If true, an anchor at a newline matches.  */
-  unsigned newline_anchor : 1;
-
 @end example
 
 
-@node GNU Regular Expression Compiling, GNU Matching, GNU Pattern Buffers, GNU Regex Functions
+@node GNU Regular Expression Compiling
 @subsection GNU Regular Expression Compiling
 
-In @sc{gnu}, you can both match and search for a given regular
+In GNU, you can both match and search for a given regular
 expression.  To do either, you must first compile it in a pattern buffer
 (@pxref{GNU Pattern Buffers}).
 
 @cindex syntax initialization
 @vindex re_syntax_options @r{initialization}
 Regular expressions match according to the syntax with which they were
-compiled; with @sc{gnu}, you indicate what syntax you want by setting
-the variable @code{re_syntax_options} (declared in @file{regex.h} and
-defined in @file{regex.c}) before calling the compiling function,
-@code{re_compile_pattern} (see below).  @xref{Syntax Bits}, and
-@ref{Predefined Syntaxes}.
+compiled; with GNU, you indicate what syntax you want by setting
+the variable @code{re_syntax_options} (declared in @file{regex.h})
+before calling the compiling function, @code{re_compile_pattern} (see
+below).  @xref{Syntax Bits}, and @ref{Predefined Syntaxes}.
 
 You can change the value of @code{re_syntax_options} at any time.
 Usually, however, you set its value once and then never change it.
@@ -1824,8 +1567,8 @@ To compile a pattern buffer, use:
 
 @findex re_compile_pattern
 @example
-char * 
-re_compile_pattern (const char *@var{regex}, const int @var{regex_size}, 
+char *
+re_compile_pattern (const char *@var{regex}, const int @var{regex_size},
                     struct re_pattern_buffer *@var{pattern_buffer})
 @end example
 
@@ -1842,10 +1585,6 @@ compiled pattern.  It sets the pattern buffer's fields as follows:
 @vindex buffer @r{field, set by @code{re_compile_pattern}}
 to the compiled pattern.
 
-@item used
-@vindex used @r{field, set by @code{re_compile_pattern}}
-to the number of bytes the compiled pattern in @code{buffer} occupies.
-
 @item syntax
 @vindex syntax @r{field, set by @code{re_compile_pattern}}
 to the current value of @code{re_syntax_options}.
@@ -1854,28 +1593,18 @@ to the current value of @code{re_syntax_options}.
 @vindex re_nsub @r{field, set by @code{re_compile_pattern}}
 to the number of subexpressions in @var{regex}.
 
-@item fastmap_accurate
-@vindex fastmap_accurate @r{field, set by @code{re_compile_pattern}}
-to zero on the theory that the pattern you're compiling is different
-than the one previously compiled into @code{buffer}; in that case (since
-you can't make a fastmap without a compiled pattern), 
-@code{fastmap} would either contain an incompatible fastmap, or nothing
-at all.
-
-@c xx what else?
 @end table
 
 If @code{re_compile_pattern} can't compile @var{regex}, it returns an
-error string corresponding to one of the errors listed in @ref{POSIX
-Regular Expression Compiling}.
+error string corresponding to a POSIX error code.
 
 
-@node GNU Matching, GNU Searching, GNU Regular Expression Compiling, GNU Regex Functions
-@subsection GNU Matching 
+@node GNU Matching
+@subsection GNU Matching
 
 @cindex matching with GNU functions
 
-Matching the @sc{gnu} way means trying to match as much of a string as
+Matching the GNU way means trying to match as much of a string as
 possible starting at a position within it you specify.  Once you've compiled
 a pattern into a pattern buffer (@pxref{GNU Regular Expression
 Compiling}), you can ask the matcher to match that pattern against a
@@ -1884,8 +1613,8 @@ string using:
 @findex re_match
 @example
 int
-re_match (struct re_pattern_buffer *@var{pattern_buffer}, 
-          const char *@var{string}, const int @var{size}, 
+re_match (struct re_pattern_buffer *@var{pattern_buffer},
+          const char *@var{string}, const int @var{size},
           const int @var{start}, struct re_registers *@var{regs})
 @end example
 
@@ -1895,17 +1624,16 @@ compiled pattern.  @var{string} is the string you want to match; it can
 contain newline and null characters.  @var{size} is the length of that
 string.  @var{start} is the string index at which you want to
 begin matching; the first character of @var{string} is at index zero.
-@xref{Using Registers}, for a explanation of @var{regs}; you can safely
+@xref{Using Registers}, for an explanation of @var{regs}; you can safely
 pass zero.
 
 @code{re_match} matches the regular expression in @var{pattern_buffer}
-against the string @var{string} according to the syntax in
-@var{pattern_buffers}'s @code{syntax} field.  (@xref{GNU Regular
-Expression Compiling}, for how to set it.)  The function returns
-@math{-1} if the compiled pattern does not match any part of
-@var{string} and @math{-2} if an internal error happens; otherwise, it
-returns how many (possibly zero) characters of @var{string} the pattern
-matched.
+against the string @var{string} according to the syntax of
+@var{pattern_buffer}.  (@xref{GNU Regular Expression Compiling}, for how
+to set it.)  The function returns @math{-1} if the compiled pattern does
+not match any part of @var{string} and @math{-2} if an internal error
+happens; otherwise, it returns how many (possibly zero) characters of
+@var{string} the pattern matched.
 
 An example: suppose @var{pattern_buffer} points to a pattern buffer
 containing the compiled pattern for @samp{a*}, and @var{string} points
@@ -1920,8 +1648,8 @@ If @var{start} is not between zero and @var{size}, then
 @code{re_match} returns @math{-1}.
 
 
-@node GNU Searching, Matching/Searching with Split Data, GNU Matching, GNU Regex Functions
-@subsection GNU Searching 
+@node GNU Searching
+@subsection GNU Searching
 
 @cindex searching with GNU functions
 
@@ -1935,10 +1663,10 @@ Here is the function declaration:
 
 @findex re_search
 @example
-int 
-re_search (struct re_pattern_buffer *@var{pattern_buffer}, 
-           const char *@var{string}, const int @var{size}, 
-           const int @var{start}, const int @var{range}, 
+int
+re_search (struct re_pattern_buffer *@var{pattern_buffer},
+           const char *@var{string}, const int @var{size},
+           const int @var{start}, const int @var{range},
            struct re_registers *@var{regs})
 @end example
 
@@ -1954,7 +1682,7 @@ starting first at index @var{start}, then at @math{@var{start} + 1} if
 that fails, and so on, up to @math{@var{start} + @var{range}}; if
 @var{range} is negative, then it attempts a match starting first at
 index @var{start}, then at @math{@var{start} -1} if that fails, and so
-on.  
+on.
 
 If @var{start} is not between zero and @var{size}, then @code{re_search}
 returns @math{-1}.  When @var{range} is positive, @code{re_search}
@@ -1974,22 +1702,22 @@ a match is found, it returns the index where the match began.  If an
 internal error happens, it returns @math{-2}.
 
 
-@node Matching/Searching with Split Data, Searching with Fastmaps, GNU Searching, GNU Regex Functions
+@node Matching/Searching with Split Data
 @subsection Matching and Searching with Split Data
 
 Using the functions @code{re_match_2} and @code{re_search_2}, you can
-match or search in data that is divided into two strings.  
+match or search in data that is divided into two strings.
 
 The function:
 
 @findex re_match_2
 @example
 int
-re_match_2 (struct re_pattern_buffer *@var{buffer}, 
-            const char *@var{string1}, const int @var{size1}, 
-            const char *@var{string2}, const int @var{size2}, 
-            const int @var{start}, 
-            struct re_registers *@var{regs}, 
+re_match_2 (struct re_pattern_buffer *@var{buffer},
+            const char *@var{string1}, const int @var{size1},
+            const char *@var{string2}, const int @var{size2},
+            const int @var{start},
+            struct re_registers *@var{regs},
             const int @var{stop})
 @end example
 
@@ -2001,18 +1729,18 @@ which you don't want the matcher to try matching.  As with
 characters of @var{string} it matched.  Regard @var{string1} and
 @var{string2} as concatenated when you set the arguments @var{start} and
 @var{stop} and use the contents of @var{regs}; @code{re_match_2} never
-returns a value larger than @math{@var{size1} + @var{size2}}.  
+returns a value larger than @math{@var{size1} + @var{size2}}.
 
 The function:
 
 @findex re_search_2
 @example
 int
-re_search_2 (struct re_pattern_buffer *@var{buffer}, 
-             const char *@var{string1}, const int @var{size1}, 
-             const char *@var{string2}, const int @var{size2}, 
-             const int @var{start}, const int @var{range}, 
-             struct re_registers *@var{regs}, 
+re_search_2 (struct re_pattern_buffer *@var{buffer},
+             const char *@var{string1}, const int @var{size1},
+             const char *@var{string2}, const int @var{size2},
+             const int @var{start}, const int @var{range},
+             struct re_registers *@var{regs},
              const int @var{stop})
 @end example
 
@@ -2020,7 +1748,7 @@ re_search_2 (struct re_pattern_buffer *@var{buffer},
 is similarly related to @code{re_search}.
 
 
-@node Searching with Fastmaps, GNU Translate Tables, Matching/Searching with Split Data, GNU Regex Functions
+@node Searching with Fastmaps
 @subsection Searching with Fastmaps
 
 @cindex fastmaps
@@ -2032,13 +1760,19 @@ string than it does to check in a table whether or not the character at
 that position could start a match.  A @dfn{fastmap} is such a table.
 
 More specifically, a fastmap is an array indexed by the characters in
-your character set.  Under the @sc{ascii} encoding, therefore, a fastmap
+your character set.  Under the ASCII encoding, therefore, a fastmap
 has 256 elements.  If you want the searcher to use a fastmap with a
 given pattern buffer, you must allocate the array and assign the array's
 address to the pattern buffer's @code{fastmap} field.  You either can
 compile the fastmap yourself or have @code{re_search} do it for you;
 when @code{fastmap} is nonzero, it automatically compiles a fastmap the
-first time you search using a particular compiled pattern.  
+first time you search using a particular compiled pattern.
+
+By setting the buffer's @code{fastmap} field before calling
+@code{re_compile_pattern}, you can reuse a buffer data structure across
+multiple searches with different patterns, and allocate the fastmap only
+once.  Nonetheless, the fastmap must be recompiled each time the buffer
+has a new pattern compiled into it.
 
 To compile a fastmap yourself, use:
 
@@ -2077,16 +1811,16 @@ want a fastmap.  @code{re_search} will still either do nothing if
 @code{fastmap} is null or, if it isn't, compile a new fastmap for the
 new pattern.
 
-@node GNU Translate Tables, Using Registers, Searching with Fastmaps, GNU Regex Functions
+@node GNU Translate Tables
 @subsection GNU Translate Tables
 
 If you set the @code{translate} field of a pattern buffer to a translate
-table, then the @sc{gnu} Regex functions to which you've passed that
+table, then the GNU Regex functions to which you've passed that
 pattern buffer use it to apply a simple transformation
 to all the regular expression and string characters at which they look.
 
 A @dfn{translate table} is an array indexed by the characters in your
-character set.  Under the @sc{ascii} encoding, therefore, a translate
+character set.  Under the ASCII encoding, therefore, a translate
 table has 256 elements.  The array's elements are also characters in
 your character set.  When the Regex functions see a character @var{c},
 they use @code{translate[@var{c}]} in its place, with one exception: the
@@ -2099,7 +1833,7 @@ differences in case.@footnote{A table that maps all uppercase letters to
 the corresponding lowercase ones would work just as well for this
 purpose.}  Such a table would map all characters except lowercase letters
 to themselves, and lowercase letters to the corresponding uppercase
-ones.  Under the @sc{ascii} encoding, here's how you could initialize
+ones.  Under the ASCII encoding, here's how you could initialize
 such a table (we'll call it @code{case_fold}):
 
 @example
@@ -2116,16 +1850,16 @@ this field.  You'll get weird results if you change the table's contents
 anytime between compiling the pattern buffer, compiling its fastmap, and
 matching or searching with the pattern buffer.
 
-@node Using Registers, Freeing GNU Pattern Buffers, GNU Translate Tables, GNU Regex Functions
+@node Using Registers
 @subsection Using Registers
 
-A group in a regular expression can match a (posssibly empty) substring
+A group in a regular expression can match a (possibly empty) substring
 of the string that regular expression as a whole matched.  The matcher
 remembers the beginning and end of the substring matched by
 each group.
 
 To find out what they matched, pass a nonzero @var{regs} argument to a
-@sc{gnu} matching or searching function (@pxref{GNU Matching} and
+GNU matching or searching function (@pxref{GNU Matching} and
 @ref{GNU Searching}), i.e., the address of a structure of this type, as
 defined in @file{regex.h}:
 
@@ -2151,53 +1885,51 @@ as C pointers, but this is only because not all C compilers accept
 zero-length arrays; conceptually, it is simplest to think of them as
 arrays.)
 
-The @code{start} and @code{end} arrays are allocated in various ways,
-depending on the value of the @code{regs_allocated}
-@vindex regs_allocated
-field in the pattern buffer passed to the matcher.
-
+The @code{start} and @code{end} arrays are allocated in one of two ways.
 The simplest and perhaps most useful is to let the matcher (re)allocate
 enough space to record information for all the groups in the regular
-expression.  If @code{regs_allocated} is @code{REGS_UNALLOCATED},
-@vindex REGS_UNALLOCATED
-the matcher allocates @math{1 + @var{re_nsub}} (another field in the
-pattern buffer; @pxref{GNU Pattern Buffers}).  The extra element is set
-to @math{-1}, and sets @code{regs_allocated} to @code{REGS_REALLOCATE}.
-@vindex REGS_REALLOCATE
-Then on subsequent calls with the same pattern buffer and @var{regs}
-arguments, the matcher reallocates more space if necessary.
-
-It would perhaps be more logical to make the @code{regs_allocated} field
-part of the @code{re_registers} structure, instead of part of the
-pattern buffer.  But in that case the caller would be forced to
-initialize the structure before passing it.  Much existing code doesn't
-do this initialization, and it's arguably better to avoid it anyway.
-
-@code{re_compile_pattern} sets @code{regs_allocated} to
-@code{REGS_UNALLOCATED},
-so if you use the GNU regular expression
-functions, you get this behavior by default.
-
-xx document re_set_registers
-
-@sc{posix}, on the other hand, requires a different interface:  the
-caller is supposed to pass in a fixed-length array which the matcher
-fills.  Therefore, if @code{regs_allocated} is @code{REGS_FIXED} 
-@vindex REGS_FIXED
-the matcher simply fills that array.
+expression.  If @code{re_set_registers} is not called before searching
+or matching, then the matcher allocates two arrays each of @math{1 +
+@var{re_nsub}} elements (@var{re_nsub} is another field in the pattern
+buffer; @pxref{GNU Pattern Buffers}).  The extra element is set to
+@math{-1}.  Then on subsequent calls with the same pattern buffer and
+@var{regs} arguments, the matcher reallocates more space if necessary.
+
+The function:
+
+@findex re_set_registers
+@example
+void
+re_set_registers (struct re_pattern_buffer *@var{buffer},
+                             struct re_registers *@var{regs},
+                             size_t @var{num_regs},
+                             regoff_t *@var{starts}, regoff_t *@var{ends})
+@end example
+
+@noindent sets @var{regs} to hold @var{num_regs} registers, storing
+them in @var{starts} and @var{ends}.  Subsequent matches using
+@var{buffer} and @var{regs} will use this memory for recording
+register information.  @var{starts} and @var{ends} must be allocated
+with malloc, and must each be at least @math{@var{num_regs} *
+@code{sizeof (regoff_t)}} bytes long.
+
+If @var{num_regs} is zero, then subsequent matches should allocate
+their own register data.
+
+Unless this function is called, the first search or match using
+@var{buffer} will allocate its own register data, without freeing the
+old data.
 
 The following examples illustrate the information recorded in the
 @code{re_registers} structure.  (In all of them, @samp{(} represents the
 open-group and @samp{)} the close-group operator.  The first character
 in the string @var{string} is at index 0.)
 
-@c xx i'm not sure this is all true anymore.
-
 @itemize @bullet
 
-@item 
+@item
 If the regular expression has an @w{@var{i}-th}
-group not contained within another group that matches a
+group that matches a
 substring of @var{string}, then the function sets
 @code{@w{@var{regs}->}start[@var{i}]} to the index in @var{string} where
 the substring matched by the @w{@var{i}-th} group begins, and
@@ -2210,16 +1942,16 @@ For example, when you match @samp{((a)(b))} against @samp{ab}, you get:
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]}
 
 @item
-0 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]} 
+0 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]}
 
 @item
-0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]} 
+0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]}
 
 @item
-1 in @code{@w{@var{regs}->}start[3]} and 2 in @code{@w{@var{regs}->}end[3]} 
+1 in @code{@w{@var{regs}->}start[3]} and 2 in @code{@w{@var{regs}->}end[3]}
 @end itemize
 
 @item
@@ -2232,10 +1964,10 @@ For example, when you match the pattern @samp{(a)*} against the string
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]}
 
 @item
-1 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]} 
+1 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]}
 @end itemize
 
 @item
@@ -2250,48 +1982,31 @@ the string @samp{b}, you get:
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
 
 @item
-@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]} 
+@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]}
 @end itemize
 
 @item
 If the @w{@var{i}-th} group matches a zero-length string, then the
 function sets @code{@w{@var{regs}->}start[@var{i}]} and
 @code{@w{@var{regs}->}end[@var{i}]} to the index just beyond that
-zero-length string.  
+zero-length string.
 
 For example, when you match the pattern @samp{(a*)b} against the string
 @samp{b}, you get:
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]} 
-
-@item
-0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]} 
-@end itemize
-
-@ignore
-The function sets @code{@w{@var{regs}->}start[0]} and
-@code{@w{@var{regs}->}end[0]} to analogous information about the entire
-pattern.
-
-For example, when you match the pattern @samp{(a*)} against the empty
-string, you get:
-
-@itemize
-@item
-0 in @code{@w{@var{regs}->}start[0]} and 0 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
 
 @item
-0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]} 
+0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]}
 @end itemize
-@end ignore
 
 @item
-If an @w{@var{i}-th} group contains a @w{@var{j}-th} group 
+If an @w{@var{i}-th} group contains a @w{@var{j}-th} group
 in turn not contained within any other group within group @var{i} and
 the function reports a match of the @w{@var{i}-th} group, then it
 records in @code{@w{@var{regs}->}start[@var{j}]} and
@@ -2304,13 +2019,13 @@ get what it previously matched:
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]}
 
 @item
-2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]} 
+2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]}
 
 @item
-2 in @code{@w{@var{regs}->}start[2]} and 2 in @code{@w{@var{regs}->}end[2]} 
+2 in @code{@w{@var{regs}->}start[2]} and 2 in @code{@w{@var{regs}->}end[2]}
 @end itemize
 
 When you match the pattern @samp{((a)*b)*} against the string
@@ -2319,20 +2034,20 @@ get:
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]}
 
 @item
-2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]} 
+2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]}
 
 @item
-0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]} 
+0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]}
 @end itemize
 
 @item
 If an @w{@var{i}-th} group contains a @w{@var{j}-th} group
 in turn not contained within any other group within group @var{i}
-and the function sets 
-@code{@w{@var{regs}->}start[@var{i}]} and 
+and the function sets
+@code{@w{@var{regs}->}start[@var{i}]} and
 @code{@w{@var{regs}->}end[@var{i}]} to @math{-1}, then it also sets
 @code{@w{@var{regs}->}start[@var{j}]} and
 @code{@w{@var{regs}->}end[@var{j}]} to @math{-1}.
@@ -2342,350 +2057,59 @@ string @samp{c}, you get:
 
 @itemize
 @item
-0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]} 
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
 
 @item
-@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]} 
+@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]}
 
 @item
-@math{-1} in @code{@w{@var{regs}->}start[2]} and @math{-1} in @code{@w{@var{regs}->}end[2]} 
+@math{-1} in @code{@w{@var{regs}->}start[2]} and @math{-1} in @code{@w{@var{regs}->}end[2]}
 @end itemize
 
 @end itemize
 
-@node Freeing GNU Pattern Buffers,  , Using Registers, GNU Regex Functions
+@node Freeing GNU Pattern Buffers
 @subsection Freeing GNU Pattern Buffers
 
-To free any allocated fields of a pattern buffer, you can use the
-@sc{posix} function described in @ref{Freeing POSIX Pattern Buffers},
-since the type @code{regex_t}---the type for @sc{posix} pattern
-buffers---is equivalent to the type @code{re_pattern_buffer}.  After
-freeing a pattern buffer, you need to again compile a regular expression
-in it (@pxref{GNU Regular Expression Compiling}) before passing it to
-a matching or searching function.
-
-
-@node POSIX Regex Functions, BSD Regex Functions, GNU Regex Functions, Programming with Regex
-@section POSIX Regex Functions
-
-If you're writing code that has to be @sc{posix} compatible, you'll need
-to use these functions. Their interfaces are as specified by @sc{posix},
-draft 1003.2/D11.2.
-
-@menu
-* POSIX Pattern Buffers::               The regex_t type.
-* POSIX Regular Expression Compiling::  regcomp ()
-* POSIX Matching::                      regexec ()
-* Reporting Errors::                    regerror ()
-* Using Byte Offsets::                  The regmatch_t type.
-* Freeing POSIX Pattern Buffers::       regfree ()
-@end menu
-
-
-@node POSIX Pattern Buffers, POSIX Regular Expression Compiling,  , POSIX Regex Functions
-@subsection POSIX Pattern Buffers
-
-To compile or match a given regular expression the @sc{posix} way, you
-must supply a pattern buffer exactly the way you do for @sc{gnu}
-(@pxref{GNU Pattern Buffers}).  @sc{posix} pattern buffers have type
-@code{regex_t}, which is equivalent to the @sc{gnu} pattern buffer
-type @code{re_pattern_buffer}.
-
-
-@node POSIX Regular Expression Compiling, POSIX Matching, POSIX Pattern Buffers, POSIX Regex Functions
-@subsection POSIX Regular Expression Compiling
-
-With @sc{posix}, you can only search for a given regular expression; you
-can't match it.  To do this, you must first compile it in a
-pattern buffer, using @code{regcomp}.
-
-@ignore
-Before calling @code{regcomp}, you must initialize this pattern buffer
-as you do for @sc{gnu} (@pxref{GNU Regular Expression Compiling}).  See
-below, however, for how to choose a syntax with which to compile.
-@end ignore
-
-To compile a pattern buffer, use:
-
-@findex regcomp
-@example
-int
-regcomp (regex_t *@var{preg}, const char *@var{regex}, int @var{cflags})
-@end example
-
-@noindent
-@var{preg} is the initialized pattern buffer's address, @var{regex} is
-the regular expression's address, and @var{cflags} is the compilation
-flags, which Regex considers as a collection of bits.  Here are the
-valid bits, as defined in @file{regex.h}:
-
-@table @code
-
-@item REG_EXTENDED
-@vindex REG_EXTENDED
-says to use @sc{posix} Extended Regular Expression syntax; if this isn't
-set, then says to use @sc{posix} Basic Regular Expression syntax.
-@code{regcomp} sets @var{preg}'s @code{syntax} field accordingly.
-
-@item REG_ICASE
-@vindex REG_ICASE
-@cindex ignoring case
-says to ignore case; @code{regcomp} sets @var{preg}'s @code{translate}
-field to a translate table which ignores case, replacing anything you've
-put there before.
-
-@item REG_NOSUB
-@vindex REG_NOSUB
-says to set @var{preg}'s @code{no_sub} field; @pxref{POSIX Matching},
-for what this means.
-
-@item REG_NEWLINE
-@vindex REG_NEWLINE
-says that a:
-
-@itemize @bullet
-
-@item
-match-any-character operator (@pxref{Match-any-character
-Operator}) doesn't match a newline.
-
-@item
-nonmatching list not containing a newline (@pxref{List
-Operators}) matches a newline.
-
-@item
-match-beginning-of-line operator (@pxref{Match-beginning-of-line
-Operator}) matches the empty string immediately after a newline,
-regardless of how @code{REG_NOTBOL} is set (@pxref{POSIX Matching}, for
-an explanation of @code{REG_NOTBOL}).
-
-@item
-match-end-of-line operator (@pxref{Match-beginning-of-line
-Operator}) matches the empty string immediately before a newline,
-regardless of how @code{REG_NOTEOL} is set (@pxref{POSIX Matching},
-for an explanation of @code{REG_NOTEOL}).
-
-@end itemize
-
-@end table
-
-If @code{regcomp} successfully compiles the regular expression, it
-returns zero and sets @code{*@var{pattern_buffer}} to the compiled
-pattern. Except for @code{syntax} (which it sets as explained above), it
-also sets the same fields the same way as does the @sc{gnu} compiling
-function (@pxref{GNU Regular Expression Compiling}).
-
-If @code{regcomp} can't compile the regular expression, it returns one
-of the error codes listed here.  (Except when noted differently, the
-syntax of in all examples below is basic regular expression syntax.)
-
-@table @code
-
-@comment repetitions
-@item REG_BADRPT
-For example, the consecutive repetition operators @samp{**} in
-@samp{a**} are invalid.  As another example, if the syntax is extended
-regular expression syntax, then the repetition operator @samp{*} with
-nothing on which to operate in @samp{*} is invalid.
-
-@item REG_BADBR
-For example, the @var{count} @samp{-1} in @samp{a\@{-1} is invalid.
-
-@item REG_EBRACE
-For example, @samp{a\@{1} is missing a close-interval operator.
-
-@comment lists
-@item REG_EBRACK
-For example, @samp{[a} is missing a close-list operator.
-
-@item REG_ERANGE
-For example, the range ending point @samp{z} that collates lower than
-does its starting point @samp{a} in @samp{[z-a]} is invalid.  Also, the
-range with the character class @samp{[:alpha:]} as its starting point in
-@samp{[[:alpha:]-|]}.
-
-@item REG_ECTYPE
-For example, the character class name @samp{foo} in @samp{[[:foo:]} is
-invalid.
-
-@comment groups
-@item REG_EPAREN
-For example, @samp{a\)} is missing an open-group operator and @samp{\(a}
-is missing a close-group operator.
-
-@item REG_ESUBREG
-For example, the back reference @samp{\2} that refers to a nonexistent
-subexpression in @samp{\(a\)\2} is invalid.
-
-@comment unfinished business
-
-@item REG_EEND
-Returned when a regular expression causes no other more specific error.
-
-@item REG_EESCAPE
-For example, the trailing backslash @samp{\} in @samp{a\} is invalid, as is the
-one in @samp{\}.
-
-@comment kitchen sink
-@item REG_BADPAT
-For example, in the extended regular expression syntax, the empty group
-@samp{()} in @samp{a()b} is invalid.
-
-@comment internal
-@item REG_ESIZE
-Returned when a regular expression needs a pattern buffer larger than
-65536 bytes.
-
-@item REG_ESPACE
-Returned when a regular expression makes Regex to run out of memory.
-
-@end table
-
-
-@node POSIX Matching, Reporting Errors, POSIX Regular Expression Compiling, POSIX Regex Functions
-@subsection POSIX Matching 
-
-Matching the @sc{posix} way means trying to match a null-terminated
-string starting at its first character.  Once you've compiled a pattern
-into a pattern buffer (@pxref{POSIX Regular Expression Compiling}), you
-can ask the matcher to match that pattern against a string using:
-
-@findex regexec
-@example
-int
-regexec (const regex_t *@var{preg}, const char *@var{string}, 
-         size_t @var{nmatch}, regmatch_t @var{pmatch}[], int @var{eflags})
-@end example
-
-@noindent
-@var{preg} is the address of a pattern buffer for a compiled pattern.
-@var{string} is the string you want to match.  
-
-@xref{Using Byte Offsets}, for an explanation of @var{pmatch}.  If you
-pass zero for @var{nmatch} or you compiled @var{preg} with the
-compilation flag @code{REG_NOSUB} set, then @code{regexec} will ignore
-@var{pmatch}; otherwise, you must allocate it to have at least
-@var{nmatch} elements.  @code{regexec} will record @var{nmatch} byte
-offsets in @var{pmatch}, and set to @math{-1} any unused elements up to
-@math{@var{pmatch}@code{[@var{nmatch}]} - 1}.
-
-@var{eflags} specifies @dfn{execution flags}---namely, the two bits
-@code{REG_NOTBOL} and @code{REG_NOTEOL} (defined in @file{regex.h}).  If
-you set @code{REG_NOTBOL}, then the match-beginning-of-line operator
-(@pxref{Match-beginning-of-line Operator}) always fails to match.
-This lets you match against pieces of a line, as you would need to if,
-say, searching for repeated instances of a given pattern in a line; it
-would work correctly for patterns both with and without
-match-beginning-of-line operators.  @code{REG_NOTEOL} works analogously
-for the match-end-of-line operator (@pxref{Match-end-of-line
-Operator}); it exists for symmetry.
-
-@code{regexec} tries to find a match for @var{preg} in @var{string}
-according to the syntax in @var{preg}'s @code{syntax} field.
-(@xref{POSIX Regular Expression Compiling}, for how to set it.)  The
-function returns zero if the compiled pattern matches @var{string} and
-@code{REG_NOMATCH} (defined in @file{regex.h}) if it doesn't.
-
-@node Reporting Errors, Using Byte Offsets, POSIX Matching, POSIX Regex Functions
-@subsection Reporting Errors
-
-If either @code{regcomp} or @code{regexec} fail, they return a nonzero
-error code, the possibilities for which are defined in @file{regex.h}.
-@xref{POSIX Regular Expression Compiling}, and @ref{POSIX Matching}, for
-what these codes mean.  To get an error string corresponding to these
-codes, you can use:
-
-@findex regerror
-@example
-size_t
-regerror (int @var{errcode},
-          const regex_t *@var{preg},
-          char *@var{errbuf},
-          size_t @var{errbuf_size})
-@end example
-
-@noindent
-@var{errcode} is an error code, @var{preg} is the address of the pattern
-buffer which provoked the error, @var{errbuf} is the error buffer, and
-@var{errbuf_size} is @var{errbuf}'s size.
-
-@code{regerror} returns the size in bytes of the error string
-corresponding to @var{errcode} (including its terminating null).  If
-@var{errbuf} and @var{errbuf_size} are nonzero, it also returns in
-@var{errbuf} the first @math{@var{errbuf_size} - 1} characters of the
-error string, followed by a null.  
-@var{errbuf_size} must be a nonnegative number less than or equal to the
-size in bytes of @var{errbuf}.
-
-You can call @code{regerror} with a null @var{errbuf} and a zero
-@var{errbuf_size} to determine how large @var{errbuf} need be to
-accommodate @code{regerror}'s error string.
-
-@node Using Byte Offsets, Freeing POSIX Pattern Buffers, Reporting Errors, POSIX Regex Functions
-@subsection Using Byte Offsets
-
-In @sc{posix}, variables of type @code{regmatch_t} hold analogous
-information, but are not identical to, @sc{gnu}'s registers (@pxref{Using
-Registers}).  To get information about registers in @sc{posix}, pass to
-@code{regexec} a nonzero @var{pmatch} of type @code{regmatch_t}, i.e.,
-the address of a structure of this type, defined in
-@file{regex.h}:
-
-@tindex regmatch_t
-@example
-typedef struct
-@{
-  regoff_t rm_so;
-  regoff_t rm_eo;
-@} regmatch_t;
-@end example
-
-When reading in @ref{Using Registers}, about how the matching function
-stores the information into the registers, substitute @var{pmatch} for
-@var{regs}, @code{@w{@var{pmatch}[@var{i}]->}rm_so} for
-@code{@w{@var{regs}->}start[@var{i}]} and
-@code{@w{@var{pmatch}[@var{i}]->}rm_eo} for
-@code{@w{@var{regs}->}end[@var{i}]}.
-
-@node Freeing POSIX Pattern Buffers,  , Using Byte Offsets, POSIX Regex Functions
-@subsection Freeing POSIX Pattern Buffers
-
-To free any allocated fields of a pattern buffer, use:
+To free any allocated fields of a pattern buffer, use the POSIX
+function @code{regfree}:
 
 @findex regfree
 @example
-void 
+void
 regfree (regex_t *@var{preg})
 @end example
 
 @noindent
-@var{preg} is the pattern buffer whose allocated fields you want freed.
-@code{regfree} also sets @var{preg}'s @code{allocated} and @code{used}
-fields to zero.  After freeing a pattern buffer, you need to again
-compile a regular expression in it (@pxref{POSIX Regular Expression
-Compiling}) before passing it to the matching function (@pxref{POSIX
-Matching}).
+@var{preg} is the pattern buffer whose allocated fields you want freed;
+this works because since the type @code{regex_t}---the type for
+POSIX pattern buffers---is equivalent to the type
+@code{re_pattern_buffer}.
+
+@code{regfree} also sets @var{preg}'s @code{allocated} field to zero.
+After a buffer has been freed, it must have a regular expression
+compiled in it before passing it to a matching or searching function.
 
 
-@node BSD Regex Functions,  , POSIX Regex Functions, Programming with Regex
+@node BSD Regex Functions
 @section BSD Regex Functions
 
-If you're writing code that has to be Berkeley @sc{unix} compatible,
+If you're writing code that has to be Berkeley Unix compatible,
 you'll need to use these functions whose interfaces are the same as those
-in Berkeley @sc{unix}.  
+in Berkeley Unix.
 
 @menu
 * BSD Regular Expression Compiling::    re_comp ()
 * BSD Searching::                       re_exec ()
 @end menu
 
-@node BSD Regular Expression Compiling, BSD Searching,  , BSD Regex Functions
+@node BSD Regular Expression Compiling
 @subsection  BSD Regular Expression Compiling
 
-With Berkeley @sc{unix}, you can only search for a given regular
+With Berkeley Unix, you can only search for a given regular
 expression; you can't match one.  To search for it, you must first
 compile it.  Before you compile it, you must indicate the regular
-expression syntax you want it compiled according to by setting the 
+expression syntax you want it compiled according to by setting the
 variable @code{re_syntax_options} (declared in @file{regex.h} to some
 syntax (@pxref{Regular Expression Syntax}).
 
@@ -2713,10 +2137,10 @@ an error string.  @code{re_comp}'s error messages are identical to those
 of @code{re_compile_pattern} (@pxref{GNU Regular Expression
 Compiling}).
 
-@node BSD Searching,  , BSD Regular Expression Compiling, BSD Regex Functions
-@subsection BSD Searching 
+@node BSD Searching
+@subsection BSD Searching
 
-Searching the Berkeley @sc{unix} way means searching in a string
+Searching the Berkeley Unix way means searching in a string
 starting at its first character and trying successive positions within
 it to find a match.  Once you've compiled a pattern using @code{re_comp}
 (@pxref{BSD Regular Expression Compiling}), you can ask Regex
@@ -2733,406 +2157,4 @@ re_exec (char *@var{string})
 want to search.
 
 @code{re_exec} returns either 1 for success or 0 for failure.  It
-automatically uses a @sc{gnu} fastmap (@pxref{Searching with Fastmaps}).
-
-
-@node Copying, Index, Programming with Regex, Top
-@appendix GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-675 Mass Ave, Cambridge, MA 02139, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
-
-@enumerate
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term ``modification''.)  Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@enumerate a
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License.  (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end enumerate
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-@enumerate a
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code.  (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end enumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec Appendix: How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) 19@var{yy}  @var{name of author}
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License.  Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary.  Here is a sample; alter the names:
-
-@example
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end example
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-@node Index,  , Copying, Top
-@unnumbered Index
-
-@printindex cp
-
-@contents
-
-@bye
+automatically uses a GNU fastmap (@pxref{Searching with Fastmaps}).