From 15f1f50e20e7bf615f338a6e064955fff9e4ab67 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 20 Mar 2023 00:20:05 -0700 Subject: [PATCH] doc: clarify BRE vs ERE (bug#62272) --- doc/grep.in.1 | 15 ++++++++------- doc/grep.texi | 9 +++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/grep.in.1 b/doc/grep.in.1 index edc4bc7..f7b8a03 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 7a00add..4ed9782 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. -- 2.37.2