grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v3.6-16-gb216515


From: Paul Eggert
Subject: grep branch, master, updated. v3.6-16-gb216515
Date: Fri, 1 Jan 2021 22:00:13 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  b216515f9c72dd7529e3e587abed101efd1d9ae5 (commit)
       via  6b454dc20d5ce5d3a05cc0208893038fb9485cd7 (commit)
       via  bcf26593451cd9b82724934ea9abb04a1dffc3b1 (commit)
       via  e84a2ea9d2fb820d0af60f9632f869bcd5edd93a (commit)
       via  ebbb25f6ef8908ca4e9a6c8bb95a64eb2328a4d9 (commit)
      from  51452f79ce3e0cdf17fab8796fa5275acddc188e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=b216515f9c72dd7529e3e587abed101efd1d9ae5


commit b216515f9c72dd7529e3e587abed101efd1d9ae5
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Jan 1 18:27:07 2021 -0800

    doc: further clarify regexp structure
    
    * doc/grep.texi (Fundamental Structure)
    (Back-references and Subexpressions, Basic vs Extended):
    Further clarifications.

diff --git a/doc/grep.texi b/doc/grep.texi
index 630a7d7..19099cc 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1204,12 +1204,12 @@ pages, but work only if PCRE is available in the system.
 @node Fundamental Structure
 @section Fundamental Structure
 
-The fundamental building blocks are the regular expressions that match
-a single character.
-Most characters, including all letters and digits,
-are regular expressions that match themselves.
-The special characters @samp{.?*+@{|()[\^$}, unless quoted by being
-preceded by a backslash, have the following uses.
+@cindex ordinary characters
+@cindex special characters
+In regular expressions, the characters @samp{.?*+@{|()[\^$} are
+@dfn{special characters} and have uses described below.  All other
+characters are @dfn{ordinary characters}, and each ordinary character
+is a regular expression that matches itself.
 
 @opindex .
 @cindex dot
@@ -1516,14 +1516,17 @@ to beginning or end of a line, respectively.
 @cindex subexpression
 @cindex back-reference
 
-The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches
+The back-reference @samp{\@var{n}},
+where @var{n} is a single nonzero digit, matches
 the substring previously matched by the @var{n}th parenthesized subexpression
 of the regular expression.
 For example, @samp{(a)\1} matches @samp{aa}.
-When used with alternation, if the group does not participate in the match then
-the back-reference makes the whole match fail.
-For example, @samp{a(.)|b\1}
-will not match @samp{ba}.
+If the parenthesized subexpression does not participate in the match,
+the back-reference makes the whole match fail;
+for example, @samp{(a)*\1} fails to match @samp{a}.
+If the parenthesized subexpression matches more than one substring,
+the back-reference refers to the last matched substring;
+for example, @samp{^(ab*)*\1$} matches @samp{ababbabb} but not @samp{ababbab}.
 When multiple regular expressions are given with
 @option{-e} or from a file (@samp{-f @var{file}}),
 back-references are local to each expression.
@@ -1534,17 +1537,43 @@ back-references are local to each expression.
 @section Basic vs Extended Regular Expressions
 @cindex basic regular expressions
 
-In basic regular expressions the special characters @samp{?}, @samp{+},
+In basic regular expressions the characters @samp{?}, @samp{+},
 @samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning;
 instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{},
 @samp{\|}, @samp{\(}, and @samp{\)}.  Also, a backslash is needed
-before an interval expression's closing @samp{@}}.
+before an interval expression's closing @samp{@}}, and an unmatched
+@code{\)} is invalid.
+
+Portable scripts should avoid the following constructs, as
+POSIX says they produce undefined results:
+
+@itemize @bullet
+@item
+Extended regular expressions that use back-references.
+@item
+Basic regular expressions that use @samp{\?}, @samp{\+}, or @samp{\|}.
+@item
+Empty parenthesized regular expressions like @samp{()}.
+@item
+Empty alternatives (as in, e.g, @samp{a|}).
+@item
+Repetition operators that immediately follow empty expressions,
+unescaped @samp{$}, or other repetition operators.
+@item
+A backslash escaping an ordinary character (e.g., @samp{\S}),
+unless it is a back-reference.
+@item
+An unescaped @samp{[} that is not part of a bracket expression.
+@item
+In extended regular expressions, an unescaped @samp{@{} that is not
+part of an interval expression.
+@end itemize
 
 @cindex interval expressions
 Traditional @command{egrep} did not support interval expressions and
 some @command{egrep} implementations use @samp{\@{} and @samp{\@}} instead, so
-portable scripts should avoid @samp{@{} in @samp{grep@ -E} patterns and
-should use @samp{[@{]} to match a literal @samp{@{}.
+portable scripts should avoid interval expressions in @samp{grep@ -E} patterns
+and should use @samp{[@{]} to match a literal @samp{@{}.
 
 GNU @command{grep@ -E} attempts to support traditional usage by
 assuming that @samp{@{} is not special if it would be the start of an
@@ -1865,11 +1894,8 @@ Why is this back-reference failing?
 echo 'ba' | grep -E '(a)\1|b\1'
 @end example
 
-This gives no output, because the first alternate @samp{(a)\1} does not match,
-as there is no @samp{aa} in the input, so the @samp{\1} in the second alternate
+This outputs an error message, because the second @samp{\1}
 has nothing to refer back to, meaning it will never match anything.
-(The second alternate in this example can only match
-if the first alternate has matched---making the second one superfluous.)
 
 @item
 How can I match across lines?

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=6b454dc20d5ce5d3a05cc0208893038fb9485cd7


commit b216515f9c72dd7529e3e587abed101efd1d9ae5
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Jan 1 18:27:07 2021 -0800

    doc: further clarify regexp structure
    
    * doc/grep.texi (Fundamental Structure)
    (Back-references and Subexpressions, Basic vs Extended):
    Further clarifications.

diff --git a/doc/grep.texi b/doc/grep.texi
index 630a7d7..19099cc 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1204,12 +1204,12 @@ pages, but work only if PCRE is available in the system.
 @node Fundamental Structure
 @section Fundamental Structure
 
-The fundamental building blocks are the regular expressions that match
-a single character.
-Most characters, including all letters and digits,
-are regular expressions that match themselves.
-The special characters @samp{.?*+@{|()[\^$}, unless quoted by being
-preceded by a backslash, have the following uses.
+@cindex ordinary characters
+@cindex special characters
+In regular expressions, the characters @samp{.?*+@{|()[\^$} are
+@dfn{special characters} and have uses described below.  All other
+characters are @dfn{ordinary characters}, and each ordinary character
+is a regular expression that matches itself.
 
 @opindex .
 @cindex dot
@@ -1516,14 +1516,17 @@ to beginning or end of a line, respectively.
 @cindex subexpression
 @cindex back-reference
 
-The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches
+The back-reference @samp{\@var{n}},
+where @var{n} is a single nonzero digit, matches
 the substring previously matched by the @var{n}th parenthesized subexpression
 of the regular expression.
 For example, @samp{(a)\1} matches @samp{aa}.
-When used with alternation, if the group does not participate in the match then
-the back-reference makes the whole match fail.
-For example, @samp{a(.)|b\1}
-will not match @samp{ba}.
+If the parenthesized subexpression does not participate in the match,
+the back-reference makes the whole match fail;
+for example, @samp{(a)*\1} fails to match @samp{a}.
+If the parenthesized subexpression matches more than one substring,
+the back-reference refers to the last matched substring;
+for example, @samp{^(ab*)*\1$} matches @samp{ababbabb} but not @samp{ababbab}.
 When multiple regular expressions are given with
 @option{-e} or from a file (@samp{-f @var{file}}),
 back-references are local to each expression.
@@ -1534,17 +1537,43 @@ back-references are local to each expression.
 @section Basic vs Extended Regular Expressions
 @cindex basic regular expressions
 
-In basic regular expressions the special characters @samp{?}, @samp{+},
+In basic regular expressions the characters @samp{?}, @samp{+},
 @samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning;
 instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{},
 @samp{\|}, @samp{\(}, and @samp{\)}.  Also, a backslash is needed
-before an interval expression's closing @samp{@}}.
+before an interval expression's closing @samp{@}}, and an unmatched
+@code{\)} is invalid.
+
+Portable scripts should avoid the following constructs, as
+POSIX says they produce undefined results:
+
+@itemize @bullet
+@item
+Extended regular expressions that use back-references.
+@item
+Basic regular expressions that use @samp{\?}, @samp{\+}, or @samp{\|}.
+@item
+Empty parenthesized regular expressions like @samp{()}.
+@item
+Empty alternatives (as in, e.g, @samp{a|}).
+@item
+Repetition operators that immediately follow empty expressions,
+unescaped @samp{$}, or other repetition operators.
+@item
+A backslash escaping an ordinary character (e.g., @samp{\S}),
+unless it is a back-reference.
+@item
+An unescaped @samp{[} that is not part of a bracket expression.
+@item
+In extended regular expressions, an unescaped @samp{@{} that is not
+part of an interval expression.
+@end itemize
 
 @cindex interval expressions
 Traditional @command{egrep} did not support interval expressions and
 some @command{egrep} implementations use @samp{\@{} and @samp{\@}} instead, so
-portable scripts should avoid @samp{@{} in @samp{grep@ -E} patterns and
-should use @samp{[@{]} to match a literal @samp{@{}.
+portable scripts should avoid interval expressions in @samp{grep@ -E} patterns
+and should use @samp{[@{]} to match a literal @samp{@{}.
 
 GNU @command{grep@ -E} attempts to support traditional usage by
 assuming that @samp{@{} is not special if it would be the start of an
@@ -1865,11 +1894,8 @@ Why is this back-reference failing?
 echo 'ba' | grep -E '(a)\1|b\1'
 @end example
 
-This gives no output, because the first alternate @samp{(a)\1} does not match,
-as there is no @samp{aa} in the input, so the @samp{\1} in the second alternate
+This outputs an error message, because the second @samp{\1}
 has nothing to refer back to, meaning it will never match anything.
-(The second alternate in this example can only match
-if the first alternate has matched---making the second one superfluous.)
 
 @item
 How can I match across lines?

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=bcf26593451cd9b82724934ea9abb04a1dffc3b1


commit b216515f9c72dd7529e3e587abed101efd1d9ae5
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Jan 1 18:27:07 2021 -0800

    doc: further clarify regexp structure
    
    * doc/grep.texi (Fundamental Structure)
    (Back-references and Subexpressions, Basic vs Extended):
    Further clarifications.

diff --git a/doc/grep.texi b/doc/grep.texi
index 630a7d7..19099cc 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1204,12 +1204,12 @@ pages, but work only if PCRE is available in the system.
 @node Fundamental Structure
 @section Fundamental Structure
 
-The fundamental building blocks are the regular expressions that match
-a single character.
-Most characters, including all letters and digits,
-are regular expressions that match themselves.
-The special characters @samp{.?*+@{|()[\^$}, unless quoted by being
-preceded by a backslash, have the following uses.
+@cindex ordinary characters
+@cindex special characters
+In regular expressions, the characters @samp{.?*+@{|()[\^$} are
+@dfn{special characters} and have uses described below.  All other
+characters are @dfn{ordinary characters}, and each ordinary character
+is a regular expression that matches itself.
 
 @opindex .
 @cindex dot
@@ -1516,14 +1516,17 @@ to beginning or end of a line, respectively.
 @cindex subexpression
 @cindex back-reference
 
-The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches
+The back-reference @samp{\@var{n}},
+where @var{n} is a single nonzero digit, matches
 the substring previously matched by the @var{n}th parenthesized subexpression
 of the regular expression.
 For example, @samp{(a)\1} matches @samp{aa}.
-When used with alternation, if the group does not participate in the match then
-the back-reference makes the whole match fail.
-For example, @samp{a(.)|b\1}
-will not match @samp{ba}.
+If the parenthesized subexpression does not participate in the match,
+the back-reference makes the whole match fail;
+for example, @samp{(a)*\1} fails to match @samp{a}.
+If the parenthesized subexpression matches more than one substring,
+the back-reference refers to the last matched substring;
+for example, @samp{^(ab*)*\1$} matches @samp{ababbabb} but not @samp{ababbab}.
 When multiple regular expressions are given with
 @option{-e} or from a file (@samp{-f @var{file}}),
 back-references are local to each expression.
@@ -1534,17 +1537,43 @@ back-references are local to each expression.
 @section Basic vs Extended Regular Expressions
 @cindex basic regular expressions
 
-In basic regular expressions the special characters @samp{?}, @samp{+},
+In basic regular expressions the characters @samp{?}, @samp{+},
 @samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning;
 instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{},
 @samp{\|}, @samp{\(}, and @samp{\)}.  Also, a backslash is needed
-before an interval expression's closing @samp{@}}.
+before an interval expression's closing @samp{@}}, and an unmatched
+@code{\)} is invalid.
+
+Portable scripts should avoid the following constructs, as
+POSIX says they produce undefined results:
+
+@itemize @bullet
+@item
+Extended regular expressions that use back-references.
+@item
+Basic regular expressions that use @samp{\?}, @samp{\+}, or @samp{\|}.
+@item
+Empty parenthesized regular expressions like @samp{()}.
+@item
+Empty alternatives (as in, e.g, @samp{a|}).
+@item
+Repetition operators that immediately follow empty expressions,
+unescaped @samp{$}, or other repetition operators.
+@item
+A backslash escaping an ordinary character (e.g., @samp{\S}),
+unless it is a back-reference.
+@item
+An unescaped @samp{[} that is not part of a bracket expression.
+@item
+In extended regular expressions, an unescaped @samp{@{} that is not
+part of an interval expression.
+@end itemize
 
 @cindex interval expressions
 Traditional @command{egrep} did not support interval expressions and
 some @command{egrep} implementations use @samp{\@{} and @samp{\@}} instead, so
-portable scripts should avoid @samp{@{} in @samp{grep@ -E} patterns and
-should use @samp{[@{]} to match a literal @samp{@{}.
+portable scripts should avoid interval expressions in @samp{grep@ -E} patterns
+and should use @samp{[@{]} to match a literal @samp{@{}.
 
 GNU @command{grep@ -E} attempts to support traditional usage by
 assuming that @samp{@{} is not special if it would be the start of an
@@ -1865,11 +1894,8 @@ Why is this back-reference failing?
 echo 'ba' | grep -E '(a)\1|b\1'
 @end example
 
-This gives no output, because the first alternate @samp{(a)\1} does not match,
-as there is no @samp{aa} in the input, so the @samp{\1} in the second alternate
+This outputs an error message, because the second @samp{\1}
 has nothing to refer back to, meaning it will never match anything.
-(The second alternate in this example can only match
-if the first alternate has matched---making the second one superfluous.)
 
 @item
 How can I match across lines?

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=e84a2ea9d2fb820d0af60f9632f869bcd5edd93a


commit b216515f9c72dd7529e3e587abed101efd1d9ae5
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Jan 1 18:27:07 2021 -0800

    doc: further clarify regexp structure
    
    * doc/grep.texi (Fundamental Structure)
    (Back-references and Subexpressions, Basic vs Extended):
    Further clarifications.

diff --git a/doc/grep.texi b/doc/grep.texi
index 630a7d7..19099cc 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1204,12 +1204,12 @@ pages, but work only if PCRE is available in the system.
 @node Fundamental Structure
 @section Fundamental Structure
 
-The fundamental building blocks are the regular expressions that match
-a single character.
-Most characters, including all letters and digits,
-are regular expressions that match themselves.
-The special characters @samp{.?*+@{|()[\^$}, unless quoted by being
-preceded by a backslash, have the following uses.
+@cindex ordinary characters
+@cindex special characters
+In regular expressions, the characters @samp{.?*+@{|()[\^$} are
+@dfn{special characters} and have uses described below.  All other
+characters are @dfn{ordinary characters}, and each ordinary character
+is a regular expression that matches itself.
 
 @opindex .
 @cindex dot
@@ -1516,14 +1516,17 @@ to beginning or end of a line, respectively.
 @cindex subexpression
 @cindex back-reference
 
-The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches
+The back-reference @samp{\@var{n}},
+where @var{n} is a single nonzero digit, matches
 the substring previously matched by the @var{n}th parenthesized subexpression
 of the regular expression.
 For example, @samp{(a)\1} matches @samp{aa}.
-When used with alternation, if the group does not participate in the match then
-the back-reference makes the whole match fail.
-For example, @samp{a(.)|b\1}
-will not match @samp{ba}.
+If the parenthesized subexpression does not participate in the match,
+the back-reference makes the whole match fail;
+for example, @samp{(a)*\1} fails to match @samp{a}.
+If the parenthesized subexpression matches more than one substring,
+the back-reference refers to the last matched substring;
+for example, @samp{^(ab*)*\1$} matches @samp{ababbabb} but not @samp{ababbab}.
 When multiple regular expressions are given with
 @option{-e} or from a file (@samp{-f @var{file}}),
 back-references are local to each expression.
@@ -1534,17 +1537,43 @@ back-references are local to each expression.
 @section Basic vs Extended Regular Expressions
 @cindex basic regular expressions
 
-In basic regular expressions the special characters @samp{?}, @samp{+},
+In basic regular expressions the characters @samp{?}, @samp{+},
 @samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning;
 instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{},
 @samp{\|}, @samp{\(}, and @samp{\)}.  Also, a backslash is needed
-before an interval expression's closing @samp{@}}.
+before an interval expression's closing @samp{@}}, and an unmatched
+@code{\)} is invalid.
+
+Portable scripts should avoid the following constructs, as
+POSIX says they produce undefined results:
+
+@itemize @bullet
+@item
+Extended regular expressions that use back-references.
+@item
+Basic regular expressions that use @samp{\?}, @samp{\+}, or @samp{\|}.
+@item
+Empty parenthesized regular expressions like @samp{()}.
+@item
+Empty alternatives (as in, e.g, @samp{a|}).
+@item
+Repetition operators that immediately follow empty expressions,
+unescaped @samp{$}, or other repetition operators.
+@item
+A backslash escaping an ordinary character (e.g., @samp{\S}),
+unless it is a back-reference.
+@item
+An unescaped @samp{[} that is not part of a bracket expression.
+@item
+In extended regular expressions, an unescaped @samp{@{} that is not
+part of an interval expression.
+@end itemize
 
 @cindex interval expressions
 Traditional @command{egrep} did not support interval expressions and
 some @command{egrep} implementations use @samp{\@{} and @samp{\@}} instead, so
-portable scripts should avoid @samp{@{} in @samp{grep@ -E} patterns and
-should use @samp{[@{]} to match a literal @samp{@{}.
+portable scripts should avoid interval expressions in @samp{grep@ -E} patterns
+and should use @samp{[@{]} to match a literal @samp{@{}.
 
 GNU @command{grep@ -E} attempts to support traditional usage by
 assuming that @samp{@{} is not special if it would be the start of an
@@ -1865,11 +1894,8 @@ Why is this back-reference failing?
 echo 'ba' | grep -E '(a)\1|b\1'
 @end example
 
-This gives no output, because the first alternate @samp{(a)\1} does not match,
-as there is no @samp{aa} in the input, so the @samp{\1} in the second alternate
+This outputs an error message, because the second @samp{\1}
 has nothing to refer back to, meaning it will never match anything.
-(The second alternate in this example can only match
-if the first alternate has matched---making the second one superfluous.)
 
 @item
 How can I match across lines?

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=ebbb25f6ef8908ca4e9a6c8bb95a64eb2328a4d9


commit b216515f9c72dd7529e3e587abed101efd1d9ae5
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Jan 1 18:27:07 2021 -0800

    doc: further clarify regexp structure
    
    * doc/grep.texi (Fundamental Structure)
    (Back-references and Subexpressions, Basic vs Extended):
    Further clarifications.

diff --git a/doc/grep.texi b/doc/grep.texi
index 630a7d7..19099cc 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1204,12 +1204,12 @@ pages, but work only if PCRE is available in the system.
 @node Fundamental Structure
 @section Fundamental Structure
 
-The fundamental building blocks are the regular expressions that match
-a single character.
-Most characters, including all letters and digits,
-are regular expressions that match themselves.
-The special characters @samp{.?*+@{|()[\^$}, unless quoted by being
-preceded by a backslash, have the following uses.
+@cindex ordinary characters
+@cindex special characters
+In regular expressions, the characters @samp{.?*+@{|()[\^$} are
+@dfn{special characters} and have uses described below.  All other
+characters are @dfn{ordinary characters}, and each ordinary character
+is a regular expression that matches itself.
 
 @opindex .
 @cindex dot
@@ -1516,14 +1516,17 @@ to beginning or end of a line, respectively.
 @cindex subexpression
 @cindex back-reference
 
-The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches
+The back-reference @samp{\@var{n}},
+where @var{n} is a single nonzero digit, matches
 the substring previously matched by the @var{n}th parenthesized subexpression
 of the regular expression.
 For example, @samp{(a)\1} matches @samp{aa}.
-When used with alternation, if the group does not participate in the match then
-the back-reference makes the whole match fail.
-For example, @samp{a(.)|b\1}
-will not match @samp{ba}.
+If the parenthesized subexpression does not participate in the match,
+the back-reference makes the whole match fail;
+for example, @samp{(a)*\1} fails to match @samp{a}.
+If the parenthesized subexpression matches more than one substring,
+the back-reference refers to the last matched substring;
+for example, @samp{^(ab*)*\1$} matches @samp{ababbabb} but not @samp{ababbab}.
 When multiple regular expressions are given with
 @option{-e} or from a file (@samp{-f @var{file}}),
 back-references are local to each expression.
@@ -1534,17 +1537,43 @@ back-references are local to each expression.
 @section Basic vs Extended Regular Expressions
 @cindex basic regular expressions
 
-In basic regular expressions the special characters @samp{?}, @samp{+},
+In basic regular expressions the characters @samp{?}, @samp{+},
 @samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning;
 instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{},
 @samp{\|}, @samp{\(}, and @samp{\)}.  Also, a backslash is needed
-before an interval expression's closing @samp{@}}.
+before an interval expression's closing @samp{@}}, and an unmatched
+@code{\)} is invalid.
+
+Portable scripts should avoid the following constructs, as
+POSIX says they produce undefined results:
+
+@itemize @bullet
+@item
+Extended regular expressions that use back-references.
+@item
+Basic regular expressions that use @samp{\?}, @samp{\+}, or @samp{\|}.
+@item
+Empty parenthesized regular expressions like @samp{()}.
+@item
+Empty alternatives (as in, e.g, @samp{a|}).
+@item
+Repetition operators that immediately follow empty expressions,
+unescaped @samp{$}, or other repetition operators.
+@item
+A backslash escaping an ordinary character (e.g., @samp{\S}),
+unless it is a back-reference.
+@item
+An unescaped @samp{[} that is not part of a bracket expression.
+@item
+In extended regular expressions, an unescaped @samp{@{} that is not
+part of an interval expression.
+@end itemize
 
 @cindex interval expressions
 Traditional @command{egrep} did not support interval expressions and
 some @command{egrep} implementations use @samp{\@{} and @samp{\@}} instead, so
-portable scripts should avoid @samp{@{} in @samp{grep@ -E} patterns and
-should use @samp{[@{]} to match a literal @samp{@{}.
+portable scripts should avoid interval expressions in @samp{grep@ -E} patterns
+and should use @samp{[@{]} to match a literal @samp{@{}.
 
 GNU @command{grep@ -E} attempts to support traditional usage by
 assuming that @samp{@{} is not special if it would be the start of an
@@ -1865,11 +1894,8 @@ Why is this back-reference failing?
 echo 'ba' | grep -E '(a)\1|b\1'
 @end example
 
-This gives no output, because the first alternate @samp{(a)\1} does not match,
-as there is no @samp{aa} in the input, so the @samp{\1} in the second alternate
+This outputs an error message, because the second @samp{\1}
 has nothing to refer back to, meaning it will never match anything.
-(The second alternate in this example can only match
-if the first alternate has matched---making the second one superfluous.)
 
 @item
 How can I match across lines?

-----------------------------------------------------------------------

Summary of changes:
 AUTHORS                                    |  2 +-
 ChangeLog-2009                             |  2 +-
 HACKING                                    |  2 +-
 Makefile.am                                |  2 +-
 NEWS                                       |  2 +-
 README                                     |  2 +-
 README-alpha                               |  2 +-
 README-hacking                             |  2 +-
 TODO                                       |  2 +-
 bootstrap                                  | 22 ++++++++--
 bootstrap.conf                             |  2 +-
 cfg.mk                                     |  2 +-
 configure.ac                               |  2 +-
 doc/Makefile.am                            |  2 +-
 doc/grep.in.1                              |  2 +-
 doc/grep.texi                              | 68 +++++++++++++++++++++---------
 gnulib                                     |  2 +-
 lib/Makefile.am                            |  2 +-
 lib/colorize-posix.c                       |  2 +-
 lib/colorize-w32.c                         |  2 +-
 lib/colorize.h                             |  2 +-
 m4/pcre.m4                                 |  2 +-
 po/POTFILES.in                             |  2 +-
 src/Makefile.am                            |  2 +-
 src/dfasearch.c                            |  2 +-
 src/die.h                                  |  2 +-
 src/grep.c                                 |  2 +-
 src/grep.h                                 |  2 +-
 src/kwsearch.c                             |  2 +-
 src/kwset.c                                |  2 +-
 src/kwset.h                                |  2 +-
 src/pcresearch.c                           |  2 +-
 src/search.h                               |  2 +-
 src/searchutils.c                          |  2 +-
 src/system.h                               |  2 +-
 tests/Coreutils.pm                         |  2 +-
 tests/CuSkip.pm                            |  2 +-
 tests/CuTmpdir.pm                          |  2 +-
 tests/Makefile.am                          |  2 +-
 tests/backref                              |  2 +-
 tests/backref-alt                          |  2 +-
 tests/backslash-dot                        |  2 +-
 tests/backslash-s-and-repetition-operators |  2 +-
 tests/backslash-s-vs-invalid-multibyte     |  2 +-
 tests/binary-file-matches                  |  2 +-
 tests/bre                                  |  2 +-
 tests/bre.awk                              |  2 +-
 tests/c-locale                             |  2 +-
 tests/case-fold-titlecase                  |  2 +-
 tests/count-newline                        |  2 +-
 tests/dfa-coverage                         |  2 +-
 tests/dfa-heap-overrun                     |  2 +-
 tests/dfa-invalid-utf8                     |  2 +-
 tests/empty                                |  2 +-
 tests/empty-line-mb                        |  2 +-
 tests/encoding-error                       |  2 +-
 tests/envvar-check                         |  2 +-
 tests/ere                                  |  2 +-
 tests/ere.awk                              |  2 +-
 tests/false-match-mb-non-utf8              |  2 +-
 tests/fgrep-longest                        |  2 +-
 tests/file                                 |  2 +-
 tests/filename-lineno.pl                   |  2 +-
 tests/fmbtest                              |  2 +-
 tests/foad1                                |  2 +-
 tests/get-mb-cur-max.c                     |  2 +-
 tests/hash-collision-perf                  |  2 +-
 tests/help-version                         |  2 +-
 tests/high-bit-range                       |  2 +-
 tests/init.sh                              |  4 +-
 tests/initial-tab                          |  2 +-
 tests/khadafy                              |  2 +-
 tests/kwset-abuse                          |  2 +-
 tests/long-pattern-perf                    |  2 +-
 tests/many-regex-performance               |  2 +-
 tests/match-lines                          |  2 +-
 tests/mb-dot-newline                       |  2 +-
 tests/mb-non-UTF8-overrun                  |  2 +-
 tests/mb-non-UTF8-perf-Fw                  |  2 +-
 tests/mb-non-UTF8-performance              |  2 +-
 tests/mb-non-UTF8-word-boundary            |  2 +-
 tests/multibyte-white-space                |  2 +-
 tests/multiple-begin-or-end-line           |  2 +-
 tests/null-byte                            |  2 +-
 tests/options                              |  2 +-
 tests/pcre                                 |  2 +-
 tests/pcre-abort                           |  2 +-
 tests/pcre-count                           |  2 +-
 tests/pcre-infloop                         |  2 +-
 tests/pcre-invalid-utf8-infloop            |  2 +-
 tests/pcre-invalid-utf8-input              |  2 +-
 tests/pcre-jitstack                        |  2 +-
 tests/pcre-o                               |  2 +-
 tests/pcre-utf8                            |  2 +-
 tests/pcre-w                               |  2 +-
 tests/pcre-wx-backref                      |  2 +-
 tests/posix-bracket                        |  2 +-
 tests/proc                                 |  2 +-
 tests/spencer1                             |  2 +-
 tests/spencer1-locale                      |  2 +-
 tests/spencer1-locale.awk                  |  2 +-
 tests/spencer1.awk                         |  2 +-
 tests/spencer2                             |  2 +-
 tests/status                               |  2 +-
 tests/surrogate-pair                       |  2 +-
 tests/symlink                              |  2 +-
 tests/tests                                |  2 +-
 tests/triple-backref                       |  2 +-
 tests/turkish-I                            |  2 +-
 tests/turkish-I-without-dot                |  2 +-
 tests/turkish-eyes                         |  2 +-
 tests/two-chars                            |  2 +-
 tests/two-files                            |  2 +-
 tests/unibyte-binary                       |  2 +-
 tests/unibyte-bracket-expr                 |  2 +-
 tests/unibyte-negated-circumflex           |  2 +-
 tests/utf8-bracket                         |  2 +-
 tests/write-error-msg                      |  2 +-
 tests/yesno                                |  2 +-
 tests/z-anchor-newline                     |  2 +-
 120 files changed, 184 insertions(+), 144 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]