>From f61187acad67bf34cd1fd9fbbacd2a0a8fb054b1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 31 Dec 2015 00:50:43 -0800 Subject: [PATCH] doc: minor clarifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/grep.in.1, doc/grep.texi: Minor clarifications suggested by Debian documentation patches. Problem reported by Santiago Ruano Rincón in: http://bugs.gnu.org/18651 --- doc/grep.in.1 | 17 ++++++++++++----- doc/grep.texi | 8 +++++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/grep.in.1 b/doc/grep.in.1 index 2b513a8..8938478 100644 --- a/doc/grep.in.1 +++ b/doc/grep.in.1 @@ -87,7 +87,8 @@ as an extended regular expression (ERE, see below). .BR \-F ", " \-\^\-fixed\-strings Interpret .I PATTERN -as a list of fixed strings, separated by newlines, +as a list of fixed strings (instead of regular expressions), +separated by newlines, any of which is to be matched. .TP .BR \-G ", " \-\^\-basic\-regexp @@ -99,7 +100,7 @@ This is the default. .BR \-P ", " \-\^\-perl\-regexp Interpret .I PATTERN -as a Perl regular expression. +as a Perl regular expression (PCRE, see below). This is highly experimental and .B "grep \-P" may warn of unimplemented features. @@ -138,6 +139,11 @@ Word-constituent characters are letters, digits, and the underscore. .TP .BR \-x ", " \-\^\-line\-regexp Select only those matches that exactly match the whole line. +For a regular expression pattern, this is like parenthesizing the +pattern and then surrounding it with +.B ^ +and +.BR $ . .TP .B \-y Obsolete synonym for @@ -531,7 +537,8 @@ expressions, by using various operators to combine smaller expressions. .PP .B grep understands three different versions of regular expression syntax: -\*(lqbasic,\*(rq \*(lqextended\*(rq and \*(lqperl.\*(rq In +\*(lqbasic\*(rq (BRE), \*(lqextended\*(rq (ERE) and \*(lqperl\*(rq (PCRE). +In .RB "\s-1GNU\s0\ " grep , there is no difference in available functionality between basic and extended syntaxes. @@ -539,8 +546,8 @@ In other implementations, basic regular expressions are less powerful. The following description applies to extended regular expressions; differences for basic regular expressions are summarized afterwards. Perl regular expressions give additional functionality, and are -documented in pcresyntax(3) and pcrepattern(3), but may not be -available on every system. +documented in pcresyntax(3) and pcrepattern(3), but work only if +PCRE is available in the system. .PP The fundamental building blocks are the regular expressions that match a single character. diff --git a/doc/grep.texi b/doc/grep.texi index 58e7f48..73151e4 100644 --- a/doc/grep.texi +++ b/doc/grep.texi @@ -240,6 +240,8 @@ Word-constituent characters are letters, digits, and the underscore. @opindex --line-regexp @cindex match the whole line Select only those matches that exactly match the whole line. +For a regular expression pattern, this is like parenthesizing the +pattern and then surrounding it with @samp{^} and @samp{$}. (@option{-x} is specified by POSIX.) @end table @@ -1091,8 +1093,8 @@ Interpret the pattern as an extended regular expression (ERE). @opindex -F @opindex --fixed-strings @cindex matching fixed strings -Interpret the pattern as a list of fixed strings, separated -by newlines, any of which is to be matched. +Interpret the pattern as a list of fixed strings (instead of regular +expressions), separated by newlines, any of which is to be matched. (@option{-F} is specified by POSIX.) @item -P @@ -1134,7 +1136,7 @@ The following description applies to extended regular expressions; differences for basic regular expressions are summarized afterwards. Perl regular expressions give additional functionality, and are documented in the @i{pcresyntax}(3) and @i{pcrepattern}(3) manual pages, -but may not be available on every system. +but work only if PCRE is available in the system. @menu * Fundamental Structure:: -- 2.5.0