CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 18/12/30 01:24:22
Index: html_node/Matching-Control.html =================================================================== RCS file: /webcvs/grep/grep/manual/html_node/Matching-Control.html,v retrieving revision 1.28 retrieving revision 1.29 diff -u -b -r1.28 -r1.29 --- html_node/Matching-Control.html 10 Feb 2017 04:43:38 -0000 1.28 +++ html_node/Matching-Control.html 30 Dec 2018 06:24:22 -0000 1.29 @@ -2,7 +2,7 @@ <html> <!-- This manual is for grep, a pattern matching engine. -Copyright (C) 1999-2002, 2005, 2008-2017 Free Software Foundation, +Copyright (C) 1999-2002, 2005, 2008-2018 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document @@ -11,16 +11,16 @@ Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". --> -<!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ --> +<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> <head> -<title>GNU Grep 3.0: Matching Control</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>Matching Control (GNU Grep 3.3)</title> -<meta name="description" content="GNU Grep 3.0: Matching Control"> -<meta name="keywords" content="GNU Grep 3.0: Matching Control"> +<meta name="description" content="Matching Control (GNU Grep 3.3)"> +<meta name="keywords" content="Matching Control (GNU Grep 3.3)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="index.html#Top" rel="start" title="Top"> <link href="Index.html#Index" rel="index" title="Index"> <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> @@ -70,12 +70,13 @@ <h4 class="subsection">2.1.2 Matching Control</h4> <dl compact="compact"> -<dt><samp>-e <var>pattern</var></samp></dt> -<dt><samp>--regexp=<var>pattern</var></samp></dt> +<dt><samp>-e <var>patterns</var></samp></dt> +<dt><samp>--regexp=<var>patterns</var></samp></dt> <dd><a name="index-_002de"></a> -<a name="index-_002d_002dregexp_003dpattern"></a> -<a name="index-pattern-list"></a> -<p>Use <var>pattern</var> as the pattern. +<a name="index-_002d_002dregexp_003dpatterns"></a> +<a name="index-patterns-option"></a> +<p>Use <var>patterns</var> as one or more patterns; newlines within +<var>patterns</var> separate each pattern from the next. If this option is used multiple times or is combined with the <samp>-f</samp> (<samp>--file</samp>) option, search for all patterns given. (<samp>-e</samp> is specified by POSIX.) @@ -85,7 +86,7 @@ <dt><samp>--file=<var>file</var></samp></dt> <dd><a name="index-_002df"></a> <a name="index-_002d_002dfile"></a> -<a name="index-pattern-from-file"></a> +<a name="index-patterns-from-file"></a> <p>Obtain patterns from <var>file</var>, one per line. If this option is used multiple times or is combined with the <samp>-e</samp> (<samp>--regexp</samp>) option, search for all patterns given. @@ -139,9 +140,16 @@ 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 <samp>-x</samp> is also specified. </p> +<p>Because the <samp>-w</samp> option can match a substring that does not +begin and end with word constituents, it differs from surrounding a +regular expression with ‘<samp>\<</samp>’ and ‘<samp>\></samp>’. For example, although +‘<samp>grep -w @</samp>’ matches a line containing only ‘<samp>@</samp>’, ‘<samp>grep +'\<@\>'</samp>’ cannot match any line because ‘<samp>@</samp>’ is not a +word constituent. See <a href="The-Backslash-Character-and-Special-Expressions.html#The-Backslash-Character-and-Special-Expressions">The Backslash Character and Special Expressions</a>. +</p> </dd> <dt><samp>-x</samp></dt> <dt><samp>--line-regexp</samp></dt> @@ -149,7 +157,7 @@ <a name="index-_002d_002dline_002dregexp"></a> <a name="index-match-the-whole-line"></a> <p>Select only those matches that exactly match the whole line. -For a regular expression pattern, this is like parenthesizing the +For regular expression patterns, this is like parenthesizing each pattern and then surrounding it with ‘<samp>^</samp>’ and ‘<samp>$</samp>’. (<samp>-x</samp> is specified by POSIX.) </p>
