>From cdd82ebbebe0113d0d252b385cc84e80d8ceac3a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 25 Jul 2017 00:55:01 -0700 Subject: [PATCH] doc: distinguish -w from \<...\> * doc/grep.texi (Matching Control): Give example of why -w differs from \<...\> (Bug#27813). --- doc/grep.texi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/grep.texi b/doc/grep.texi index 64df316..24800c9 100644 --- a/doc/grep.texi +++ b/doc/grep.texi @@ -235,9 +235,17 @@ or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. -Word-constituent characters are letters, digits, and the underscore. +Word constituent characters are letters, digits, and the underscore. This option has no effect if @option{-x} is also specified. +Because the @option{-w} option can match a substring that does not +begin and end with word constituents, it differs from surrounding a +pattern with @samp{\<} and @samp{\>}. For example, although address@hidden -w @@} matches a line containing only @samp{@@}, @samp{grep +'\<@@\>'} cannot match any line because @samp{@@} is not a +word constituent. @xref{The Backslash Character and Special +Expressions}. + @item -x @itemx --line-regexp @opindex -x -- 2.7.4