summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-03-20 00:20:05 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-03-20 00:24:10 -0700
commit15f1f50e20e7bf615f338a6e064955fff9e4ab67 (patch)
treef7523886174e4a85785ee3a886e1fdbbc86da85d
parent98ee05b4ddfee5c1db2248bdb060a2cd64bf75fa (diff)
downloadgrep-15f1f50e20e7bf615f338a6e064955fff9e4ab67.tar.gz
doc: clarify BRE vs ERE (bug#62272)
-rw-r--r--doc/grep.in.115
-rw-r--r--doc/grep.texi9
2 files changed, 13 insertions, 11 deletions
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index edc4bc75..f7b8a03e 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -715,12 +715,12 @@ This can cause a performance penalty.
.BR \-U ", " \-\^\-binary
Treat the file(s) as binary.
By default, under MS-DOS and MS-Windows,
-.BR grep
+.B grep
guesses whether a file is text or binary as described for the
.B \-\^\-binary\-files
option.
If
-.BR grep
+.B grep
decides the file is a text file, it strips the CR characters from the
original file contents (to make regular expressions with
.B ^
@@ -756,13 +756,14 @@ expressions, by using various operators to combine smaller expressions.
understands three different versions of regular expression syntax:
\*(lqbasic\*(rq (BRE), \*(lqextended\*(rq (ERE) and \*(lqperl\*(rq (PCRE).
In GNU
-.B grep
-there is no difference in available functionality between basic and
-extended syntax.
-In other implementations, basic regular expressions are less powerful.
+.BR grep ,
+basic and extended regular expressions are merely different notations
+for the same pattern-matching functionality.
+In other implementations, basic regular expressions are ordinarily
+less powerful than extended, though occasionally it is the other way around.
The following description applies to extended regular expressions;
differences for basic regular expressions are summarized afterwards.
-Perl-compatible regular expressions give additional functionality, and are
+Perl-compatible regular expressions have different functionality, and are
documented in
.BR pcre2syntax (3)
and
diff --git a/doc/grep.texi b/doc/grep.texi
index 7a00adda..4ed9782d 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1190,12 +1190,13 @@ by using various operators to combine smaller expressions.
three different versions of regular expression syntax:
basic (BRE), extended (ERE), and Perl-compatible (PCRE).
In GNU @command{grep},
-there is no difference in available functionality between basic and
-extended syntax.
-In other implementations, basic regular expressions are less powerful.
+basic and extended regular expressions are merely different notations
+for the same pattern-matching functionality.
+In other implementations, basic regular expressions are ordinarily
+less powerful than extended, though occasionally it is the other way around.
The following description applies to extended regular expressions;
differences for basic regular expressions are summarized afterwards.
-Perl-compatible regular expressions give additional functionality, and
+Perl-compatible regular expressions have different functionality, and
are documented in the @i{pcre2syntax}(3) and @i{pcre2pattern}(3) manual
pages, but work only if PCRE is available in the system.