summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-12-31 00:50:43 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-12-31 00:51:06 -0800
commitd719afe5a025a7be3c60b0efcf0656f93a6716b6 (patch)
tree0401d8aa5eae6b20a0ad4cb84b742cad5fa82028
parent450c11293bd54b9e630f2bab26706d13b584de07 (diff)
downloadgrep-d719afe5a025a7be3c60b0efcf0656f93a6716b6.tar.gz
doc: minor clarifications
* 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
-rw-r--r--doc/grep.in.117
-rw-r--r--doc/grep.texi8
2 files changed, 17 insertions, 8 deletions
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index 2b513a83..8938478c 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 58e7f483..73151e4e 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::