[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about some fields in regex's re_pattern_buffer
From: |
Bruno Haible |
Subject: |
Re: Question about some fields in regex's re_pattern_buffer |
Date: |
Sun, 1 Aug 2010 18:49:04 +0200 |
User-agent: |
KMail/1.9.9 |
Reuben Thomas wrote:
> I mean the manual from the old GNU regex distribution at:
> http://ftp.gnu.org/old-gnu/regex/regex-0.12.tar.gz
> which documents the GNU API.
Paolo Bonzini wrote:
> A chapter maybe. But Bruno is the doc guru.
I think it makes sense to move this doc to gnulib, since it is a superset
of the doc in libc, and since no-one would expect to find documentation
for a gnulib module in a 17 year old tarball.
I'm adding it, and integrating it through the attached patch.
Now, please submit and commit patches that bring this doc up to date!
2010-08-01 Bruno Haible <address@hidden>
Integrate the regex documentation.
* doc/gnulib.texi: Define 'cn' index.
(Regular expressions): New a chapter that includes regex.texi and
regexprops-generic.texi.
* doc/regex.texi: Remove boilerplate stuff. Use simplified @node
syntax.
--- ChangeLog.orig Sun Aug 1 18:46:52 2010
+++ ChangeLog Sun Aug 1 18:43:03 2010
@@ -1,5 +1,12 @@
2010-08-01 Bruno Haible <address@hidden>
+ Integrate the regex documentation.
+ * doc/gnulib.texi: Define 'cn' index.
+ (Regular expressions): New a chapter that includes regex.texi and
+ regexprops-generic.texi.
+ * doc/regex.texi: Remove boilerplate stuff. Use simplified @node
+ syntax.
+
Whitespace cleanup.
* doc/regex.texi: Remove trailing spaces.
--- doc/gnulib.texi.orig Sun Aug 1 18:46:52 2010
+++ doc/gnulib.texi Sun Aug 1 18:46:09 2010
@@ -2,8 +2,14 @@
@comment %**start of header
@setfilename gnulib.info
@settitle GNU Gnulib
address@hidden Define a new index for the magic constants in regex.texi.
address@hidden cn
@syncodeindex fn cp
address@hidden ky cp
@syncodeindex pg cp
address@hidden tp cp
address@hidden vr cp
address@hidden cn cp
@ifclear texi2html
@firstparagraphindent insert
@end ifclear
@@ -63,6 +69,7 @@
* Glibc Header File Substitutes:: Overriding system headers.
* Glibc Function Substitutes:: Replacing system functions.
* Particular Modules:: Documentation of individual modules.
+* Regular expressions:: The regex module.
* GNU Free Documentation License:: Copying and sharing this manual.
* Index::
@end menu
@@ -6486,7 +6493,6 @@
* Quoting::
* error and progname::
* gcd::
-* Regular expressions::
* Searching for Libraries::
* Exported Symbols of Shared Libraries::
* LD Version Scripts::
@@ -6568,16 +6574,6 @@
@include gcd.texi
address@hidden Regular expressions
address@hidden Regular expressions
-
-Gnulib supports many different types of regular expressions; although
-the underlying features are the same or identical, the syntax used
-varies. The descriptions given here for the different types are
-generated automatically.
-
address@hidden regexprops-generic.texi
-
@include havelib.texi
@include lib-symbol-visibility.texi
@@ -6596,6 +6592,34 @@
@include valgrind-tests.texi
address@hidden Regular expressions
address@hidden Regular expressions
+
address@hidden
+* Overview::
+* Regular Expression Syntax::
+* Common Operators::
+* GNU Operators::
+* GNU Emacs Operators::
+* What Gets Matched?::
+* Programming with Regex::
+* Regular expression syntaxes::
address@hidden menu
+
address@hidden
address@hidden regex.texi
address@hidden
+
address@hidden Regular expression syntaxes
address@hidden Regular expression syntaxes
+
+Gnulib supports many different types of regular expressions; although
+the underlying features are the same or identical, the syntax used
+varies. The descriptions given here for the different types are
+generated automatically.
+
address@hidden regexprops-generic.texi
+
@node GNU Free Documentation License
@appendix GNU Free Documentation License
--- doc/regex.texi.orig Sun Aug 1 18:46:52 2010
+++ doc/regex.texi Sun Aug 1 18:37:17 2010
@@ -1,213 +1,4 @@
-\input texinfo
address@hidden %**start of header
address@hidden regex.info
address@hidden Regex
address@hidden %**end of header
-
address@hidden \\{fill-paragraph} works better (for me, anyway) if the text in
the
address@hidden source file isn't indented.
address@hidden 2
-
address@hidden Define a new index for our magic constants.
address@hidden cn
-
address@hidden Put everything in one index (arbitrarily chosen to be the
concept index).
address@hidden cn cp
address@hidden ky cp
address@hidden pg cp
address@hidden tp cp
address@hidden vr cp
-
address@hidden Here is what we use in the Info `dir' file:
address@hidden * Regex: (regex). Regular expression library.
-
-
address@hidden
-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.
-
address@hidden
-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).
address@hidden 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.
address@hidden ifinfo
-
-
address@hidden
-
address@hidden Regex
address@hidden edition 0.12a
address@hidden 19 September 1992
address@hidden Kathryn A. Hargreaves
address@hidden Karl Berry
-
address@hidden
-
address@hidden 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.
-
address@hidden titlepage
-
-
address@hidden
address@hidden Top, Overview, (dir), (dir)
address@hidden 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.
-
address@hidden
-* 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:: * + ? @address@hidden
-* 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:: @address@hidden
-
-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 ()
address@hidden menu
address@hidden ifinfo
address@hidden Overview, Regular Expression Syntax, Top, Top
address@hidden Overview
@chapter Overview
A @dfn{regular expression} (or @dfn{regexp}, or @dfn{pattern}) is a text
@@ -263,7 +54,7 @@
particular program understands.
address@hidden Regular Expression Syntax, Common Operators, Overview, Top
address@hidden Regular Expression Syntax
@chapter Regular Expression Syntax
@cindex regular expressions, syntax of
@@ -301,7 +92,7 @@
@end menu
address@hidden Syntax Bits, Predefined Syntaxes, , Regular Expression Syntax
address@hidden Syntax Bits
@section Syntax Bits
@cindex syntax bits
@@ -461,7 +252,7 @@
@end table
address@hidden Predefined Syntaxes, Collating Elements vs. Characters, Syntax
Bits, Regular Expression Syntax
address@hidden Predefined Syntaxes
@section Predefined Syntaxes
If you're programming with Regex, you can set a pattern buffer's
@@ -543,7 +334,7 @@
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
@end example
address@hidden Collating Elements vs. Characters, The Backslash Character,
Predefined Syntaxes, Regular Expression Syntax
address@hidden Collating Elements vs. Characters
@section Collating Elements vs.@: Characters
@sc{posix} generalizes the notion of a character to that of a
@@ -568,7 +359,7 @@
Since @sc{posix}'s ``collating element'' preserves the essential idea of
a ``character,'' we use the latter, more familiar, term in this document.
address@hidden The Backslash Character, , Collating Elements vs. Characters,
Regular Expression Syntax
address@hidden The Backslash Character
@section The Backslash Character
@cindex \
@@ -659,7 +450,7 @@
@end enumerate
address@hidden Common Operators, GNU Operators, Regular Expression Syntax, Top
address@hidden Common Operators
@chapter Common Operators
You compose regular expressions from operators. In the following
@@ -691,7 +482,7 @@
* Anchoring Operators:: ^ $
@end menu
address@hidden Match-self Operator, Match-any-character Operator, , Common
Operators
address@hidden Match-self Operator
@section The Match-self Operator (@var{ordinary character})
This operator matches the character itself. All ordinary characters
@@ -700,7 +491,7 @@
expression @samp{f} matches only the string @samp{f}. In
particular, it does @emph{not} match the string @samp{ff}.
address@hidden Match-any-character Operator, Concatenation Operator, Match-self
Operator, Common Operators
address@hidden Match-any-character Operator
@section The Match-any-character Operator (@code{.})
@cindex @samp{.}
@@ -721,7 +512,7 @@
@samp{a.b} matches any three-character string beginning with @samp{a}
and ending with @samp{b}.
address@hidden Concatenation Operator, Repetition Operators,
Match-any-character Operator, Common Operators
address@hidden Concatenation Operator
@section The Concatenation Operator
This operator concatenates two regular expressions @var{a} and @var{b}.
@@ -730,7 +521,7 @@
@var{a} matches its first part and @var{b} matches the rest. For
example, @samp{xy} (two match-self operators) matches @samp{xy}.
address@hidden Repetition Operators, Alternation Operator, Concatenation
Operator, Common Operators
address@hidden Repetition Operators
@section Repetition Operators
Repetition operators repeat the preceding regular expression a specified
@@ -743,7 +534,7 @@
* Interval Operators:: @address@hidden
@end menu
address@hidden Match-zero-or-more Operator, Match-one-or-more Operator, ,
Repetition Operators
address@hidden Match-zero-or-more Operator
@subsection The Match-zero-or-more Operator (@code{*})
@cindex @samp{*}
@@ -804,7 +595,7 @@
in the string. It can then match the remaining @samp{ar}.
address@hidden Match-one-or-more Operator, Match-zero-or-one Operator,
Match-zero-or-more Operator, Repetition Operators
address@hidden Match-one-or-more Operator
@subsection The Match-one-or-more Operator (@code{+} or @code{\+})
@cindex @samp{+}
@@ -823,7 +614,7 @@
operator; then @samp{ca+r} matches, e.g., @samp{car} and
@samp{caaaar}, but not @samp{cr}.
address@hidden Match-zero-or-one Operator, Interval Operators,
Match-one-or-more Operator, Repetition Operators
address@hidden Match-zero-or-one Operator
@subsection The Match-zero-or-one Operator (@code{?} or @code{\?})
@cindex @samp{?}
@@ -841,7 +632,7 @@
operator; then @samp{ca?r} matches both @samp{car} and @samp{cr}, but
nothing else.
address@hidden Interval Operators, , Match-zero-or-one Operator, Repetition
Operators
address@hidden Interval Operators
@subsection Interval Operators (@address@hidden @dots{} @address@hidden or
@address@hidden @dots{} @address@hidden)
@cindex interval expression
@@ -903,7 +694,7 @@
ordinary.
address@hidden Alternation Operator, List Operators, Repetition Operators,
Common Operators
address@hidden Alternation Operator
@section The Alternation Operator (@code{|} or @code{\|})
@kindex |
@@ -969,7 +760,7 @@
@comment xx something about leftmost-longest
address@hidden List Operators, Grouping Operators, Alternation Operator, Common
Operators
address@hidden List Operators
@section List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{}
@code{]})
@cindex matching list
@@ -1112,7 +903,7 @@
@end ignore
address@hidden Character Class Operators, Range Operator, , List Operators
address@hidden Character Class Operators
@subsection Character Class Operators (@code{[:} @dots{} @code{:]})
@cindex character classes
@@ -1177,7 +968,7 @@
@samp{[:alpha:]} outside of a bracket expression and not followed by a
repetition operator matches just itself.
address@hidden Range Operator, , Character Class Operators, List Operators
address@hidden Range Operator
@subsection The Range Operator (@code{-})
Regex recognizes @dfn{range expressions} inside a list. They represent
@@ -1237,7 +1028,7 @@
English, in @sc{ascii}).
address@hidden Grouping Operators, Back-reference Operator, List Operators,
Common Operators
address@hidden Grouping Operators
@section Grouping Operators (@code{(} @dots{} @code{)} or @code{\(} @dots{}
@code{\)})
@kindex (
@@ -1287,7 +1078,7 @@
considers it to match @samp{)}.
address@hidden Back-reference Operator, Anchoring Operators, Grouping
Operators, Common Operators
address@hidden Back-reference Operator
@section The Back-reference Operator (@address@hidden)
@cindex back references
@@ -1351,7 +1142,7 @@
expression is invalid.
address@hidden Anchoring Operators, , Back-reference Operator, Common Operators
address@hidden Anchoring Operators
@section Anchoring Operators
@cindex anchoring
@@ -1366,7 +1157,7 @@
@end menu
address@hidden Match-beginning-of-line Operator, Match-end-of-line Operator, ,
Anchoring Operators
address@hidden Match-beginning-of-line Operator
@subsection The Match-beginning-of-line Operator (@code{^})
@kindex ^
@@ -1414,7 +1205,7 @@
regard the string to be matched as broken into lines.
address@hidden Match-end-of-line Operator, , Match-beginning-of-line Operator,
Anchoring Operators
address@hidden Match-end-of-line Operator
@subsection The Match-end-of-line Operator (@code{$})
@kindex $
@@ -1435,7 +1226,7 @@
``after'' becomes ``before''.)
address@hidden GNU Operators, GNU Emacs Operators, Common Operators, Top
address@hidden GNU Operators
@chapter GNU Operators
Following are operators that @sc{gnu} defines (and @sc{posix} doesn't).
@@ -1445,7 +1236,7 @@
* Buffer Operators::
@end menu
address@hidden Word Operators, Buffer Operators, , GNU Operators
address@hidden Word Operators
@section Word Operators
The operators in this section require Regex to recognize parts of words.
@@ -1462,7 +1253,7 @@
* Match-non-word-constituent Operator:: \W
@end menu
address@hidden Non-Emacs Syntax Tables, Match-word-boundary Operator, , Word
Operators
address@hidden Non-Emacs Syntax Tables
@subsection Non-Emacs Syntax Tables
A @dfn{syntax table} is an array indexed by the characters in your
@@ -1490,7 +1281,7 @@
@end itemize
address@hidden Match-word-boundary Operator, Match-within-word Operator,
Non-Emacs Syntax Tables, Word Operators
address@hidden Match-word-boundary Operator
@subsection The Match-word-boundary Operator (@code{\b})
@cindex @samp{\b}
@@ -1500,7 +1291,7 @@
either the beginning or the end of a word. For example, @samp{\brat\b}
matches the separate word @samp{rat}.
address@hidden Match-within-word Operator, Match-beginning-of-word Operator,
Match-word-boundary Operator, Word Operators
address@hidden Match-within-word Operator
@subsection The Match-within-word Operator (@code{\B})
@cindex @samp{\B}
@@ -1509,7 +1300,7 @@
a word. For example, @samp{c\Brat\Be} matches @samp{crate}, but
@samp{dirty \Brat} doesn't match @samp{dirty rat}.
address@hidden Match-beginning-of-word Operator, Match-end-of-word Operator,
Match-within-word Operator, Word Operators
address@hidden Match-beginning-of-word Operator
@subsection The Match-beginning-of-word Operator (@code{\<})
@cindex @samp{\<}
@@ -1517,7 +1308,7 @@
This operator (represented by @samp{\<}) matches the empty string at the
beginning of a word.
address@hidden Match-end-of-word Operator, Match-word-constituent Operator,
Match-beginning-of-word Operator, Word Operators
address@hidden Match-end-of-word Operator
@subsection The Match-end-of-word Operator (@code{\>})
@cindex @samp{\>}
@@ -1525,7 +1316,7 @@
This operator (represented by @samp{\>}) matches the empty string at the
end of a word.
address@hidden Match-word-constituent Operator, Match-non-word-constituent
Operator, Match-end-of-word Operator, Word Operators
address@hidden Match-word-constituent Operator
@subsection The Match-word-constituent Operator (@code{\w})
@cindex @samp{\w}
@@ -1533,7 +1324,7 @@
This operator (represented by @samp{\w}) matches any word-constituent
character.
address@hidden Match-non-word-constituent Operator, , Match-word-constituent
Operator, Word Operators
address@hidden Match-non-word-constituent Operator
@subsection The Match-non-word-constituent Operator (@code{\W})
@cindex @samp{\W}
@@ -1542,7 +1333,7 @@
not word-constituent.
address@hidden Buffer Operators, , Word Operators, GNU Operators
address@hidden Buffer Operators
@section Buffer Operators
Following are operators which work on buffers. In Emacs, a @dfn{buffer}
@@ -1555,7 +1346,7 @@
@end menu
address@hidden Match-beginning-of-buffer Operator, Match-end-of-buffer
Operator, , Buffer Operators
address@hidden Match-beginning-of-buffer Operator
@subsection The Match-beginning-of-buffer Operator (@code{\`})
@cindex @samp{\`}
@@ -1563,7 +1354,7 @@
This operator (represented by @samp{\`}) matches the empty string at the
beginning of the buffer.
address@hidden Match-end-of-buffer Operator, , Match-beginning-of-buffer
Operator, Buffer Operators
address@hidden Match-end-of-buffer Operator
@subsection The Match-end-of-buffer Operator (@code{\'})
@cindex @samp{\'}
@@ -1572,7 +1363,7 @@
end of the buffer.
address@hidden GNU Emacs Operators, What Gets Matched?, GNU Operators, Top
address@hidden GNU Emacs Operators
@chapter GNU Emacs Operators
Following are operators that @sc{gnu} defines (and @sc{posix} doesn't)
@@ -1584,7 +1375,7 @@
@end menu
address@hidden Syntactic Class Operators, , , GNU Emacs Operators
address@hidden Syntactic Class Operators
@section Syntactic Class Operators
The operators in this section require Regex to recognize the syntactic
@@ -1596,7 +1387,7 @@
* Match-not-syntactic-class Operator:: \SCLASS
@end menu
address@hidden Emacs Syntax Tables, Match-syntactic-class Operator, ,
Syntactic Class Operators
address@hidden Emacs Syntax Tables
@subsection Emacs Syntax Tables
A @dfn{syntax table} is an array indexed by the characters in your
@@ -1610,7 +1401,7 @@
Tables}). @xref{Syntax, , Syntax, emacs, The GNU Emacs User's Manual},
for a description of Emacs' syntax tables.
address@hidden Match-syntactic-class Operator, Match-not-syntactic-class
Operator, Emacs Syntax Tables, Syntactic Class Operators
address@hidden Match-syntactic-class Operator
@subsection The Match-syntactic-class Operator (@address@hidden)
@cindex @samp{\s}
@@ -1622,7 +1413,7 @@
class of word-constituent characters, so @samp{\sw} matches any
word-constituent character.
address@hidden Match-not-syntactic-class Operator, , Match-syntactic-class
Operator, Syntactic Class Operators
address@hidden Match-not-syntactic-class Operator
@subsection The Match-not-syntactic-class Operator (@address@hidden)
@cindex @samp{\S}
@@ -1635,7 +1426,7 @@
not word-constituent.
address@hidden What Gets Matched?, Programming with Regex, GNU Emacs Operators,
Top
address@hidden What Gets Matched?
@chapter What Gets Matched?
Regex usually matches strings according to the ``leftmost longest''
@@ -1649,7 +1440,7 @@
first subexpression.
address@hidden Programming with Regex, Copying, What Gets Matched?, Top
address@hidden Programming with Regex
@chapter Programming with Regex
Here we describe how you use the Regex data structures and functions in
@@ -1663,7 +1454,7 @@
@end menu
address@hidden GNU Regex Functions, POSIX Regex Functions, , Programming with
Regex
address@hidden GNU Regex Functions
@section GNU Regex Functions
If you're writing code that doesn't need to be compatible with either
@@ -1683,7 +1474,7 @@
@end menu
address@hidden GNU Pattern Buffers, GNU Regular Expression Compiling, , GNU
Regex Functions
address@hidden GNU Pattern Buffers
@subsection GNU Pattern Buffers
@cindex pattern buffer, definition of
@@ -1766,7 +1557,7 @@
@end example
address@hidden GNU Regular Expression Compiling, GNU Matching, GNU Pattern
Buffers, GNU Regex Functions
address@hidden GNU Regular Expression Compiling
@subsection GNU Regular Expression Compiling
In @sc{gnu}, you can both match and search for a given regular
@@ -1870,7 +1661,7 @@
Regular Expression Compiling}.
address@hidden GNU Matching, GNU Searching, GNU Regular Expression Compiling,
GNU Regex Functions
address@hidden GNU Matching
@subsection GNU Matching
@cindex matching with GNU functions
@@ -1920,7 +1711,7 @@
@code{re_match} returns @math{-1}.
address@hidden GNU Searching, Matching/Searching with Split Data, GNU Matching,
GNU Regex Functions
address@hidden GNU Searching
@subsection GNU Searching
@cindex searching with GNU functions
@@ -1974,7 +1765,7 @@
internal error happens, it returns @math{-2}.
address@hidden Matching/Searching with Split Data, Searching with Fastmaps, GNU
Searching, GNU Regex Functions
address@hidden 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
@@ -2020,7 +1811,7 @@
is similarly related to @code{re_search}.
address@hidden Searching with Fastmaps, GNU Translate Tables,
Matching/Searching with Split Data, GNU Regex Functions
address@hidden Searching with Fastmaps
@subsection Searching with Fastmaps
@cindex fastmaps
@@ -2077,7 +1868,7 @@
@code{fastmap} is null or, if it isn't, compile a new fastmap for the
new pattern.
address@hidden GNU Translate Tables, Using Registers, Searching with Fastmaps,
GNU Regex Functions
address@hidden GNU Translate Tables
@subsection GNU Translate Tables
If you set the @code{translate} field of a pattern buffer to a translate
@@ -2116,7 +1907,7 @@
anytime between compiling the pattern buffer, compiling its fastmap, and
matching or searching with the pattern buffer.
address@hidden Using Registers, Freeing GNU Pattern Buffers, GNU Translate
Tables, GNU Regex Functions
address@hidden Using Registers
@subsection Using Registers
A group in a regular expression can match a (posssibly empty) substring
@@ -2353,7 +2144,7 @@
@end itemize
address@hidden Freeing GNU Pattern Buffers, , Using Registers, GNU Regex
Functions
address@hidden Freeing GNU Pattern Buffers
@subsection Freeing GNU Pattern Buffers
To free any allocated fields of a pattern buffer, you can use the
@@ -2365,7 +2156,7 @@
a matching or searching function.
address@hidden POSIX Regex Functions, BSD Regex Functions, GNU Regex Functions,
Programming with Regex
address@hidden POSIX Regex Functions
@section POSIX Regex Functions
If you're writing code that has to be @sc{posix} compatible, you'll need
@@ -2382,7 +2173,7 @@
@end menu
address@hidden POSIX Pattern Buffers, POSIX Regular Expression Compiling, ,
POSIX Regex Functions
address@hidden POSIX Pattern Buffers
@subsection POSIX Pattern Buffers
To compile or match a given regular expression the @sc{posix} way, you
@@ -2392,7 +2183,7 @@
type @code{re_pattern_buffer}.
address@hidden POSIX Regular Expression Compiling, POSIX Matching, POSIX
Pattern Buffers, POSIX Regex Functions
address@hidden POSIX Regular Expression Compiling
@subsection POSIX Regular Expression Compiling
With @sc{posix}, you can only search for a given regular expression; you
@@ -2542,7 +2333,7 @@
@end table
address@hidden POSIX Matching, Reporting Errors, POSIX Regular Expression
Compiling, POSIX Regex Functions
address@hidden POSIX Matching
@subsection POSIX Matching
Matching the @sc{posix} way means trying to match a null-terminated
@@ -2586,7 +2377,7 @@
function returns zero if the compiled pattern matches @var{string} and
@code{REG_NOMATCH} (defined in @file{regex.h}) if it doesn't.
address@hidden Reporting Errors, Using Byte Offsets, POSIX Matching, POSIX
Regex Functions
address@hidden Reporting Errors
@subsection Reporting Errors
If either @code{regcomp} or @code{regexec} fail, they return a nonzero
@@ -2621,7 +2412,7 @@
@var{errbuf_size} to determine how large @var{errbuf} need be to
accommodate @code{regerror}'s error string.
address@hidden Using Byte Offsets, Freeing POSIX Pattern Buffers, Reporting
Errors, POSIX Regex Functions
address@hidden Using Byte Offsets
@subsection Using Byte Offsets
In @sc{posix}, variables of type @code{regmatch_t} hold analogous
@@ -2647,7 +2438,7 @@
@address@hidden@address@hidden>}rm_eo} for
@address@hidden@var{regs}->address@hidden
address@hidden Freeing POSIX Pattern Buffers, , Using Byte Offsets, POSIX
Regex Functions
address@hidden Freeing POSIX Pattern Buffers
@subsection Freeing POSIX Pattern Buffers
To free any allocated fields of a pattern buffer, use:
@@ -2667,7 +2458,7 @@
Matching}).
address@hidden BSD Regex Functions, , POSIX Regex Functions, Programming with
Regex
address@hidden BSD Regex Functions
@section BSD Regex Functions
If you're writing code that has to be Berkeley @sc{unix} compatible,
@@ -2679,7 +2470,7 @@
* BSD Searching:: re_exec ()
@end menu
address@hidden BSD Regular Expression Compiling, BSD Searching, , BSD Regex
Functions
address@hidden BSD Regular Expression Compiling
@subsection BSD Regular Expression Compiling
With Berkeley @sc{unix}, you can only search for a given regular
@@ -2713,7 +2504,7 @@
of @code{re_compile_pattern} (@pxref{GNU Regular Expression
Compiling}).
address@hidden BSD Searching, , BSD Regular Expression Compiling, BSD Regex
Functions
address@hidden BSD Searching
@subsection BSD Searching
Searching the Berkeley @sc{unix} way means searching in a string
@@ -2734,405 +2525,3 @@
@code{re_exec} returns either 1 for success or 0 for failure. It
automatically uses a @sc{gnu} fastmap (@pxref{Searching with Fastmaps}).
-
-
address@hidden Copying, Index, Programming with Regex, Top
address@hidden GNU GENERAL PUBLIC LICENSE
address@hidden Version 2, June 1991
-
address@hidden
-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.
address@hidden display
-
address@hidden 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.
-
address@hidden
address@hidden TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
address@hidden iftex
address@hidden
address@hidden TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
address@hidden ifinfo
-
address@hidden
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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:
-
address@hidden a
address@hidden
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
address@hidden
-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.
-
address@hidden
-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.)
address@hidden 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.
-
address@hidden
-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:
-
address@hidden a
address@hidden
-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,
-
address@hidden
-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,
-
address@hidden
-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.)
address@hidden 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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
address@hidden NO WARRANTY
address@hidden iftex
address@hidden
address@hidden NO WARRANTY
address@hidden ifinfo
-
address@hidden
-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.
-
address@hidden
-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.
address@hidden enumerate
-
address@hidden
address@hidden END OF TERMS AND CONDITIONS
address@hidden iftex
address@hidden
address@hidden END OF TERMS AND CONDITIONS
address@hidden ifinfo
-
address@hidden
address@hidden 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.
-
address@hidden
address@hidden line to give the program's name and a brief idea of what it
does.}
-Copyright (C) address@hidden @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.
address@hidden 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:
-
address@hidden
-Gnomovision version 69, Copyright (C) address@hidden @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.
address@hidden 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
address@hidden 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:
-
address@hidden
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
address@hidden of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
address@hidden 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.
-
-
address@hidden Index, , Copying, Top
address@hidden Index
-
address@hidden cp
-
address@hidden
-
address@hidden
- Re: Question about some fields in regex's re_pattern_buffer,
Bruno Haible <=
- Re: Question about some fields in regex's re_pattern_buffer, Reuben Thomas, 2010/08/01
- Re: Question about some fields in regex's re_pattern_buffer, Reuben Thomas, 2010/08/02
- Re: Question about some fields in regex's re_pattern_buffer, Bruno Haible, 2010/08/03
- Re: Question about some fields in regex's re_pattern_buffer, Reuben Thomas, 2010/08/14
- Re: Question about some fields in regex's re_pattern_buffer, Bruno Haible, 2010/08/14
- Re: Question about some fields in regex's re_pattern_buffer, Reuben Thomas, 2010/08/14
- Re: Question about some fields in regex's re_pattern_buffer, Bruno Haible, 2010/08/14
- Re: Question about some fields in regex's re_pattern_buffer, Reuben Thomas, 2010/08/17
- Re: Question about some fields in regex's re_pattern_buffer, Karl Berry, 2010/08/17
- Re: Question about some fields in regex's re_pattern_buffer, Paolo Bonzini, 2010/08/15