CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 23/03/22 22:55:22
Index: html_node/Matching-Control.html =================================================================== RCS file: /webcvs/grep/grep/manual/html_node/Matching-Control.html,v retrieving revision 1.33 retrieving revision 1.34 diff -u -b -r1.33 -r1.34 --- html_node/Matching-Control.html 3 Sep 2022 19:33:14 -0000 1.33 +++ html_node/Matching-Control.html 23 Mar 2023 02:55:21 -0000 1.34 @@ -1,11 +1,11 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!DOCTYPE html> <html> -<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> +<!-- Created by GNU Texinfo 7.0dev, https://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- This manual is for grep, a pattern matching engine. -Copyright (C) 1999-2002, 2005, 2008-2022 Free Software Foundation, +Copyright © 1999-2002, 2005, 2008-2023 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document @@ -14,10 +14,10 @@ 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". --> -<title>Matching Control (GNU Grep 3.8)</title> +<title>Matching Control (GNU Grep 3.10)</title> -<meta name="description" content="Matching Control (GNU Grep 3.8)"> -<meta name="keywords" content="Matching Control (GNU Grep 3.8)"> +<meta name="description" content="Matching Control (GNU Grep 3.10)"> +<meta name="keywords" content="Matching Control (GNU Grep 3.10)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> @@ -31,21 +31,8 @@ <link href="Generic-Program-Information.html" rel="prev" title="Generic Program Information"> <style type="text/css"> <!-- -a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} -a.summary-letter {text-decoration: none} -blockquote.indentedblock {margin-right: 0em} -div.display {margin-left: 3.2em} -div.example {margin-left: 3.2em} -kbd {font-style: oblique} -pre.display {font-family: inherit} -pre.format {font-family: inherit} -pre.menu-comment {font-family: serif} -pre.menu-preformatted {font-family: serif} -span.nolinebreak {white-space: nowrap} -span.roman {font-family: initial; font-weight: normal} -span.sansserif {font-family: sans-serif; font-weight: normal} -span:hover a.copiable-anchor {visibility: visible} -ul.no-bullet {list-style: none} +a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em} +span:hover a.copiable-link {visibility: visible} --> </style> <link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"> @@ -54,45 +41,48 @@ </head> <body lang="en"> -<div class="subsection" id="Matching-Control"> -<div class="header"> +<div class="subsection-level-extent" id="Matching-Control"> +<div class="nav-panel"> <p> Next: <a href="General-Output-Control.html" accesskey="n" rel="next">General Output Control</a>, Previous: <a href="Generic-Program-Information.html" accesskey="p" rel="prev">Generic Program Information</a>, Up: <a href="Command_002dline-Options.html" accesskey="u" rel="up">Command-line Options</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> </div> <hr> -<span id="Matching-Control-1"></span><h4 class="subsection">2.1.2 Matching Control</h4> +<h4 class="subsection" id="Matching-Control-1"><span>2.1.2 Matching Control<a class="copiable-link" href="#Matching-Control-1"> ¶</a></span></h4> -<dl compact="compact"> -<dt id='index-_002de'><span><samp>-e <var>patterns</var></samp><a href='#index-_002de' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--regexp=<var>patterns</var></samp></span></dt> -<dd><span id="index-_002d_002dregexp_003dpatterns"></span> -<span id="index-patterns-option"></span> -<p>Use <var>patterns</var> as one or more patterns; newlines within -<var>patterns</var> separate each pattern from the next. +<dl class="table"> +<dt><samp class="option">-e <var class="var">patterns</var></samp></dt> +<dt><samp class="option">--regexp=<var class="var">patterns</var></samp></dt> +<dd><a class="index-entry-id" id="index-_002de"></a> +<a class="index-entry-id" id="index-_002d_002dregexp_003dpatterns"></a> +<a class="index-entry-id" id="index-patterns-option"></a> +<p>Use <var class="var">patterns</var> as one or more patterns; newlines within +<var class="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. -Typically <var>patterns</var> should be quoted when <code>grep</code> is used +<samp class="option">-f</samp> (<samp class="option">--file</samp>) option, search for all patterns given. +Typically <var class="var">patterns</var> should be quoted when <code class="command">grep</code> is used in a shell command. -(<samp>-e</samp> is specified by POSIX.) +(<samp class="option">-e</samp> is specified by POSIX.) </p> </dd> -<dt id='index-_002df'><span><samp>-f <var>file</var></samp><a href='#index-_002df' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--file=<var>file</var></samp></span></dt> -<dd><span id="index-_002d_002dfile"></span> -<span id="index-patterns-from-file"></span> -<p>Obtain patterns from <var>file</var>, one per line. +<dt><samp class="option">-f <var class="var">file</var></samp></dt> +<dt><samp class="option">--file=<var class="var">file</var></samp></dt> +<dd><a class="index-entry-id" id="index-_002df"></a> +<a class="index-entry-id" id="index-_002d_002dfile"></a> +<a class="index-entry-id" id="index-patterns-from-file"></a> +<p>Obtain patterns from <var class="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. +<samp class="option">-e</samp> (<samp class="option">--regexp</samp>) option, search for all patterns given. The empty file contains zero patterns, and therefore matches nothing. -(<samp>-f</samp> is specified by POSIX.) +(<samp class="option">-f</samp> is specified by POSIX.) </p> </dd> -<dt id='index-_002di'><span><samp>-i</samp><a href='#index-_002di' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>-y</samp></span></dt> -<dt><span><samp>--ignore-case</samp></span></dt> -<dd><span id="index-_002dy"></span> -<span id="index-_002d_002dignore_002dcase"></span> -<span id="index-case-insensitive-search"></span> +<dt><samp class="option">-i</samp></dt> +<dt><samp class="option">-y</samp></dt> +<dt><samp class="option">--ignore-case</samp></dt> +<dd><a class="index-entry-id" id="index-_002di"></a> +<a class="index-entry-id" id="index-_002dy"></a> +<a class="index-entry-id" id="index-_002d_002dignore_002dcase"></a> +<a class="index-entry-id" id="index-case-insensitive-search"></a> <p>Ignore case distinctions in patterns and input data, so that characters that differ only in case match each other. Although this is straightforward when letters @@ -104,33 +94,38 @@ it yields “S”. Another example: the lowercase German letter “Ô (U+00DF, LATIN SMALL LETTER SHARP S) is normally capitalized as the two-character string “SS” but it does not match “SS”, and it might -not match the uppercase letter “Ẕ (U+1E9E, LATIN CAPITAL LETTER +not match the uppercase letter +“Ẕ +(U+1E9E, LATIN CAPITAL LETTER SHARP S) even though lowercasing the latter yields the former. </p> -<p><samp>-y</samp> is an obsolete synonym that is provided for compatibility. -(<samp>-i</samp> is specified by POSIX.) +<p><samp class="option">-y</samp> is an obsolete synonym that is provided for compatibility. +(<samp class="option">-i</samp> is specified by POSIX.) </p> </dd> -<dt id='index-_002d_002dno_002dignore_002dcase'><span><samp>--no-ignore-case</samp><a href='#index-_002d_002dno_002dignore_002dcase' class='copiable-anchor'> ¶</a></span></dt> -<dd><p>Do not ignore case distinctions in patterns and input data. This is +<dt><samp class="option">--no-ignore-case</samp></dt> +<dd><a class="index-entry-id" id="index-_002d_002dno_002dignore_002dcase"></a> +<p>Do not ignore case distinctions in patterns and input data. This is the default. This option is useful for passing to shell scripts that -already use <samp>-i</samp>, in order to cancel its effects because the +already use <samp class="option">-i</samp>, in order to cancel its effects because the two options override each other. </p> </dd> -<dt id='index-_002dv'><span><samp>-v</samp><a href='#index-_002dv' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--invert-match</samp></span></dt> -<dd><span id="index-_002d_002dinvert_002dmatch"></span> -<span id="index-invert-matching"></span> -<span id="index-print-non_002dmatching-lines"></span> +<dt><samp class="option">-v</samp></dt> +<dt><samp class="option">--invert-match</samp></dt> +<dd><a class="index-entry-id" id="index-_002dv"></a> +<a class="index-entry-id" id="index-_002d_002dinvert_002dmatch"></a> +<a class="index-entry-id" id="index-invert-matching"></a> +<a class="index-entry-id" id="index-print-non_002dmatching-lines"></a> <p>Invert the sense of matching, to select non-matching lines. -(<samp>-v</samp> is specified by POSIX.) +(<samp class="option">-v</samp> is specified by POSIX.) </p> </dd> -<dt id='index-_002dw'><span><samp>-w</samp><a href='#index-_002dw' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--word-regexp</samp></span></dt> -<dd><span id="index-_002d_002dword_002dregexp"></span> -<span id="index-matching-whole-words"></span> +<dt><samp class="option">-w</samp></dt> +<dt><samp class="option">--word-regexp</samp></dt> +<dd><a class="index-entry-id" id="index-_002dw"></a> +<a class="index-entry-id" id="index-_002d_002dword_002dregexp"></a> +<a class="index-entry-id" id="index-matching-whole-words"></a> <p>Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, @@ -139,31 +134,32 @@ 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. -This option has no effect if <samp>-x</samp> is also specified. +This option has no effect if <samp class="option">-x</samp> is also specified. </p> -<p>Because the <samp>-w</samp> option can match a substring that does not +<p>Because the <samp class="option">-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="Special-Backslash-Expressions.html">Special Backslash Expressions</a>. +regular expression with ‘<samp class="samp">\<</samp>’ and ‘<samp class="samp">\></samp>’. For example, although +‘<samp class="samp">grep -w @</samp>’ matches a line containing only ‘<samp class="samp">@</samp>’, ‘<samp class="samp">grep +'\<@\>'</samp>’ cannot match any line because ‘<samp class="samp">@</samp>’ is not a +word constituent. See <a class="xref" href="Special-Backslash-Expressions.html">Special Backslash Expressions</a>. </p> </dd> -<dt id='index-_002dx'><span><samp>-x</samp><a href='#index-_002dx' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--line-regexp</samp></span></dt> -<dd><span id="index-_002d_002dline_002dregexp"></span> -<span id="index-match-the-whole-line"></span> +<dt><samp class="option">-x</samp></dt> +<dt><samp class="option">--line-regexp</samp></dt> +<dd><a class="index-entry-id" id="index-_002dx"></a> +<a class="index-entry-id" id="index-_002d_002dline_002dregexp"></a> +<a class="index-entry-id" id="index-match-the-whole-line"></a> <p>Select only those matches that exactly match the whole line. 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.) +pattern and then surrounding it with ‘<samp class="samp">^</samp>’ and ‘<samp class="samp">$</samp>’. +(<samp class="option">-x</samp> is specified by POSIX.) </p> </dd> </dl> </div> <hr> -<div class="header"> +<div class="nav-panel"> <p> Next: <a href="General-Output-Control.html">General Output Control</a>, Previous: <a href="Generic-Program-Information.html">Generic Program Information</a>, Up: <a href="Command_002dline-Options.html">Command-line Options</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> </div>
