grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to grep/manual/grep.txt,v


From: Jim Meyering
Subject: Changes to grep/manual/grep.txt,v
Date: Sat, 3 Sep 2022 15:33:15 -0400 (EDT)

CVSROOT:        /webcvs/grep
Module name:    grep
Changes by:     Jim Meyering <meyering> 22/09/03 15:33:15

Index: grep.txt
===================================================================
RCS file: /webcvs/grep/grep/manual/grep.txt,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- grep.txt    14 Aug 2021 20:46:39 -0000      1.32
+++ grep.txt    3 Sep 2022 19:33:14 -0000       1.33
@@ -15,12 +15,13 @@
 3 Regular Expressions
   3.1 Fundamental Structure
   3.2 Character Classes and Bracket Expressions
-  3.3 The Backslash Character and Special Expressions
+  3.3 Special Backslash Expressions
   3.4 Anchoring
   3.5 Back-references and Subexpressions
   3.6 Basic vs Extended Regular Expressions
-  3.7 Character Encoding
-  3.8 Matching Non-ASCII and Non-printable Characters
+  3.7 Problematic Regular Expressions
+  3.8 Character Encoding
+  3.9 Matching Non-ASCII and Non-printable Characters
 4 Usage
 5 Performance
 6 Reporting bugs
@@ -33,11 +34,11 @@
 
 ‘grep’ prints lines that contain a match for one or more patterns.
 
-   This manual is for version 3.7 of GNU Grep.
+   This manual is for version 3.8 of GNU Grep.
 
    This manual is for ‘grep’, a pattern matching engine.
 
-   Copyright © 1999–2002, 2005, 2008–2021 Free Software Foundation, Inc.
+   Copyright © 1999–2002, 2005, 2008–2022 Free Software Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
@@ -164,8 +165,8 @@
      and end with word constituents, it differs from surrounding a
      regular expression with ‘\<’ and ‘\>’.  For example, although 
‘grep
      -w @’ matches a line containing only ‘@’, ‘grep '\<@\>'’ cannot
-     match any line because ‘@’ is not a word constituent.  *Note The
-     Backslash Character and Special Expressions::.
+     match any line because ‘@’ is not a word constituent.  *Note
+     Special Backslash Expressions::.
 
 ‘-x’
 ‘--line-regexp’
@@ -185,18 +186,22 @@
 
 ‘--color[=WHEN]’
 ‘--colour[=WHEN]’
-     Surround the matched (non-empty) strings, matching lines, context
-     lines, file names, line numbers, byte offsets, and separators (for
-     fields and groups of context lines) with escape sequences to
-     display them in color on the terminal.  The colors are defined by
-     the environment variable ‘GREP_COLORS’ and default to
+     Surround matched non-empty strings, matching lines, context lines,
+     file names, line numbers, byte offsets, and separators (for fields
+     and groups of context lines) with escape sequences to display them
+     in color on the terminal.  The colors are defined by the
+     environment variable ‘GREP_COLORS’ and default to
      ‘ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36’ for bold red
      matched text, magenta file names, green line numbers, green byte
      offsets, cyan separators, and default terminal colors otherwise.
-     The deprecated environment variable ‘GREP_COLOR’ is still
-     supported, but its setting does not have priority; it defaults to
-     ‘01;31’ (bold red) which only covers the color for matched text.
-     WHEN is ‘never’, ‘always’, or ‘auto’.
+     *Note Environment Variables::.
+
+     WHEN is ‘always’ to use colors, ‘never’ to not use colors, or
+     ‘auto’ to use colors if standard output is associated with a
+     terminal device and the ‘TERM’ environment variable’s value
+     suggests that the terminal supports colors.  Plain ‘--color’ is
+     treated like ‘--color=auto’; if no ‘--color’ option is given, the
+     default is ‘--color=never’.
 
 ‘-L’
 ‘--files-without-match’
@@ -211,12 +216,16 @@
 
 ‘-m NUM’
 ‘--max-count=NUM’
-     Stop after the first NUM selected lines.  If the input is standard
-     input from a regular file, and NUM selected lines are output,
-     ‘grep’ ensures that the standard input is positioned just after the
-     last selected line before exiting, regardless of the presence of
-     trailing context lines.  This enables a calling process to resume a
-     search.  For example, the following shell script makes use of it:
+     Stop after the first NUM selected lines.  If NUM is zero, ‘grep’
+     stops right away without reading input.  A NUM of −1 is treated as
+     infinity and ‘grep’ does not stop; this is the default.
+
+     If the input is standard input from a regular file, and NUM
+     selected lines are output, ‘grep’ ensures that the standard input
+     is positioned just after the last selected line before exiting,
+     regardless of the presence of trailing context lines.  This enables
+     a calling process to resume a search.  For example, the following
+     shell script makes use of it:
 
           while grep -m 1 'PATTERN'
           do
@@ -241,9 +250,9 @@
 
 ‘-o’
 ‘--only-matching’
-     Print only the matched (non-empty) parts of matching lines, with
-     each such part on a separate output line.  Output lines use the
-     same delimiters as input, and delimiters are null bytes if ‘-z’
+     Print only the matched non-empty parts of matching lines, with each
+     such part on a separate output line.  Output lines use the same
+     delimiters as input, and delimiters are null bytes if ‘-z’
      (‘--null-data’) is also used (*note Other Options::).
 
 ‘-q’
@@ -251,23 +260,15 @@
 ‘--silent’
      Quiet; do not write anything to standard output.  Exit immediately
      with zero status if any match is found, even if an error was
-     detected.  Also see the ‘-s’ or ‘--no-messages’ option.  
(‘-q’ is
-     specified by POSIX.)
+     detected.  Also see the ‘-s’ or ‘--no-messages’ option.
+     Portability note: Solaris 10 ‘grep’ lacks ‘-q’; portable shell
+     scripts typically can redirect standard output to ‘/dev/null’
+     instead of using ‘-q’.  (‘-q’ is specified by POSIX.)
 
 ‘-s’
 ‘--no-messages’
      Suppress error messages about nonexistent or unreadable files.
-     Portability note: unlike GNU ‘grep’, 7th Edition Unix ‘grep’ did
-     not conform to POSIX, because it lacked ‘-q’ and its ‘-s’ option
-     behaved like GNU ‘grep’’s ‘-q’ option.(1)  USG-style ‘grep’ 
also
-     lacked ‘-q’ but its ‘-s’ option behaved like GNU ‘grep’’s.
-     Portable shell scripts should avoid both ‘-q’ and ‘-s’ and should
-     redirect standard and error output to ‘/dev/null’ instead.  (‘-s’
-     is specified by POSIX.)
-
-   ---------- Footnotes ----------
-
-   (1) Of course, 7th Edition Unix predated POSIX by several years!
+     (‘-s’ is specified by POSIX.)
 
 2.1.4 Output Line Prefix Control
 --------------------------------
@@ -397,8 +398,8 @@
      By default, TYPE is ‘binary’, and ‘grep’ suppresses output after
      null input binary data is discovered, and suppresses output lines
      that contain improperly encoded data.  When some output is
-     suppressed, ‘grep’ follows any output with a one-line message
-     saying that a binary file matches.
+     suppressed, ‘grep’ follows any output with a message to standard
+     error saying that a binary file matches.
 
      If TYPE is ‘without-match’, when ‘grep’ discovers null input 
binary
      data it assumes that the rest of the file does not match; this is
@@ -539,62 +540,59 @@
 2.2 Environment Variables
 =========================
 
-The behavior of ‘grep’ is affected by the following environment
-variables.
+The behavior of ‘grep’ is affected by several environment variables, the
+most important of which control the locale, which specifies how ‘grep’
+interprets characters in its patterns and data.
 
    The locale for category ‘LC_FOO’ is specified by examining the three
 environment variables ‘LC_ALL’, ‘LC_FOO’, and ‘LANG’, in that 
order.
 The first of these variables that is set specifies the locale.  For
-example, if ‘LC_ALL’ is not set, but ‘LC_COLLATE’ is set to 
‘pt_BR’,
-then the Brazilian Portuguese locale is used for the ‘LC_COLLATE’
-category.  As a special case for ‘LC_MESSAGES’ only, the environment
-variable ‘LANGUAGE’ can contain a colon-separated list of languages that
-overrides the three environment variables that ordinarily specify the
-‘LC_MESSAGES’ category.  The ‘C’ locale is used if none of these
-environment variables are set, if the locale catalog is not installed,
-or if ‘grep’ was not compiled with national language support (NLS). The
-shell command ‘locale -a’ lists locales that are currently available.
-
-   Many of the environment variables in the following list let you
-control highlighting using Select Graphic Rendition (SGR) commands
-interpreted by the terminal or terminal emulator.  (See the section in
-the documentation of your text terminal for permitted values and their
-meanings as character attributes.)  These substring values are integers
-in decimal representation and can be concatenated with semicolons.
-‘grep’ takes care of assembling the result into a complete SGR sequence
-(‘\33[’...‘m’).  Common values to concatenate include ‘1’ for 
bold, ‘4’
-for underline, ‘5’ for blink, ‘7’ for inverse, ‘39’ for default
-foreground color, ‘30’ to ‘37’ for foreground colors, ‘90’ to 
‘97’ for
-16-color mode foreground colors, ‘38;5;0’ to ‘38;5;255’ for 88-color 
and
-256-color modes foreground colors, ‘49’ for default background color,
-‘40’ to ‘47’ for background colors, ‘100’ to ‘107’ for 
16-color mode
-background colors, and ‘48;5;0’ to ‘48;5;255’ for 88-color and 
256-color
-modes background colors.
-
-   The two-letter names used in the ‘GREP_COLORS’ environment variable
-(and some of the others) refer to terminal “capabilities,” the ability
-of a terminal to highlight text, or change its color, and so on.  These
-capabilities are stored in an online database and accessed by the
-‘terminfo’ library.
+example, if ‘LC_ALL’ is not set, but ‘LC_COLLATE’ is set to
+‘pt_BR.UTF-8’, then a Brazilian Portuguese locale is used for the
+‘LC_COLLATE’ category.  As a special case for ‘LC_MESSAGES’ only, the
+environment variable ‘LANGUAGE’ can contain a colon-separated list of
+languages that overrides the three environment variables that ordinarily
+specify the ‘LC_MESSAGES’ category.  The ‘C’ locale is used if none of
+these environment variables are set, if the locale catalog is not
+installed, or if ‘grep’ was not compiled with national language support
+(NLS). The shell command ‘locale -a’ lists locales that are currently
+available.
+
+   The following environment variables affect the behavior of ‘grep’.
 
 ‘GREP_COLOR’
-     This variable specifies the color used to highlight matched
-     (non-empty) text.  It is deprecated in favor of ‘GREP_COLORS’, but
-     still supported.  The ‘mt’, ‘ms’, and ‘mc’ capabilities of
-     ‘GREP_COLORS’ have priority over it.  It can only specify the color
-     used to highlight the matching non-empty text in any matching line
-     (a selected line when the ‘-v’ command-line option is omitted, or a
-     context line when ‘-v’ is specified).  The default is ‘01;31’,
-     which means a bold red foreground text on the terminal’s default
-     background.
+     This obsolescent variable interacts with ‘GREP_COLORS’ confusingly,
+     and ‘grep’ warns if it is set and is not overridden by
+     ‘GREP_COLORS’.  Instead of ‘GREP_COLOR='COLOR'’, you can use
+     ‘GREP_COLORS='mt=COLOR'’.
 
 ‘GREP_COLORS’
      This variable specifies the colors and other attributes used to
      highlight various parts of the output.  Its value is a
      colon-separated list of ‘terminfo’ capabilities that defaults to
      ‘ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36’ with the ‘rv’
-     and ‘ne’ boolean capabilities omitted (i.e., false).  Supported
-     capabilities are as follows.
+     and ‘ne’ boolean capabilities omitted (i.e., false).  The
+     two-letter capability names refer to terminal “capabilities,” the
+     ability of a terminal to highlight text, or change its color, and
+     so on.  These capabilities are stored in an online database and
+     accessed by the ‘terminfo’ library.  Non-empty capability values
+     control highlighting using Select Graphic Rendition (SGR) commands
+     interpreted by the terminal or terminal emulator.  (See the section
+     in the documentation of your text terminal for permitted values and
+     their meanings as character attributes.)  These substring values
+     are integers in decimal representation and can be concatenated with
+     semicolons.  ‘grep’ takes care of assembling the result into a
+     complete SGR sequence (‘\33[’...‘m’).  Common values to 
concatenate
+     include ‘1’ for bold, ‘4’ for underline, ‘5’ for blink, 
‘7’ for
+     inverse, ‘39’ for default foreground color, ‘30’ to ‘37’ for
+     foreground colors, ‘90’ to ‘97’ for 16-color mode foreground
+     colors, ‘38;5;0’ to ‘38;5;255’ for 88-color and 256-color modes
+     foreground colors, ‘49’ for default background color, ‘40’ to 
‘47’
+     for background colors, ‘100’ to ‘107’ for 16-color mode background
+     colors, and ‘48;5;0’ to ‘48;5;255’ for 88-color and 256-color 
modes
+     background colors.
+
+     Supported capabilities are as follows.
 
      ‘sl=’
           SGR substring for whole selected lines (i.e., matching lines
@@ -682,7 +680,7 @@
 ‘LC_COLLATE’
 ‘LANG’
      These variables specify the locale for the ‘LC_COLLATE’ category,
-     which might affect how range expressions like ‘[a-z]’ are
+     which might affect how range expressions like ‘a-z’ are
      interpreted.
 
 ‘LC_ALL’
@@ -706,9 +704,11 @@
      more like other GNU programs.  POSIX requires that options that
      follow file names must be treated as file names; by default, such
      options are permuted to the front of the operand list and are
-     treated as options.  Also, ‘POSIXLY_CORRECT’ disables special
-     handling of an invalid bracket expression.  *Note
-     invalid-bracket-expr::.
+     treated as options.
+
+‘TERM’
+     This variable specifies the output terminal type, which can affect
+     what the ‘--color’ option does.  *Note General Output Control::.
 
 ‘_N_GNU_nonoption_argv_flags_’
      (Here ‘N’ is ‘grep’’s numeric process ID.) If the Ith character 
of
@@ -773,12 +773,6 @@
      ‘grep -P’ may warn of unimplemented features.  *Note Other
      Options::.
 
-   In addition, two variant programs ‘egrep’ and ‘fgrep’ are available.
-‘egrep’ is the same as ‘grep -E’.  ‘fgrep’ is the same as ‘grep 
-F’.
-Direct invocation as either ‘egrep’ or ‘fgrep’ is deprecated, but is
-provided to allow historical applications that rely on them to run
-unmodified.
-
 3 Regular Expressions
 *********************
 
@@ -787,13 +781,13 @@
 expressions, by using various operators to combine smaller expressions.
 ‘grep’ understands three different versions of regular expression
 syntax: basic (BRE), extended (ERE), and Perl-compatible (PCRE). In GNU
-‘grep’, there is no difference in available functionality between the
-basic and extended syntaxes.  In other implementations, basic regular
+‘grep’, there is no difference in available functionality between basic
+and extended syntax.  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-compatible regular expressions give
-additional functionality, and are documented in the pcresyntax(3) and
-pcrepattern(3) manual pages, but work only if PCRE is available in the
+additional functionality, and are documented in the pcre2syntax(3) and
+pcre2pattern(3) manual pages, but work only if PCRE is available in the
 system.
 
 3.1 Fundamental Structure
@@ -839,15 +833,18 @@
 matches any string formed by concatenating two substrings that
 respectively match the concatenated expressions.
 
-   Two regular expressions may be joined by the infix operator ‘|’; the
-resulting regular expression matches any string matching either
-alternate expression.
+   Two regular expressions may be joined by the infix operator ‘|’.  The
+resulting regular expression matches any string matching either of the
+two expressions, which are called “alternatives”.
 
    Repetition takes precedence over concatenation, which in turn takes
 precedence over alternation.  A whole expression may be enclosed in
 parentheses to override these precedence rules and form a subexpression.
 An unmatched ‘)’ matches just itself.
 
+   Not every character string is a valid regular expression.  *Note
+Problematic Expressions::.
+
 3.2 Character Classes and Bracket Expressions
 =============================================
 
@@ -866,9 +863,10 @@
 is equivalent to ‘[abcd]’.  In other locales, the sorting sequence is
 not specified, and ‘[a-d]’ might be equivalent to ‘[abcd]’ or to
 ‘[aBbCcDd]’, or it might fail to match any character, or the set of
-characters that it matches might even be erratic.  To obtain the
-traditional interpretation of bracket expressions, you can use the ‘C’
-locale by setting the ‘LC_ALL’ environment variable to the value ‘C’.
+characters that it matches might be erratic, or it might be invalid.  To
+obtain the traditional interpretation of bracket expressions, you can
+use the ‘C’ locale by setting the ‘LC_ALL’ environment variable to the
+value ‘C’.
 
    Finally, certain named classes of characters are predefined within
 bracket expressions, as follows.  Their interpretation depends on the
@@ -929,9 +927,8 @@
 
    If you mistakenly omit the outer brackets, and search for say,
 ‘[:upper:]’, GNU ‘grep’ prints a diagnostic and exits with status 2, on
-the assumption that you did not intend to search for the nominally
-equivalent regular expression: ‘[:epru]’.  Set the ‘POSIXLY_CORRECT’
-environment variable to disable this feature.
+the assumption that you did not intend to search for the regular
+expression ‘[:epru]’.
 
    Special characters lose their special meaning inside bracket
 expressions.
@@ -962,14 +959,15 @@
 
 ‘-’
      represents the range if it’s not first or last in a list or the
-     ending point of a range.
+     ending point of a range.  To make the ‘-’ a list item, it is best
+     to put it last.
 
 ‘^’
      represents the characters not in the list.  If you want to make the
      ‘^’ character a list item, place it anywhere but first.
 
-3.3 The Backslash Character and Special Expressions
-===================================================
+3.3 Special Backslash Expressions
+=================================
 
 The ‘\’ character followed by a special character is a regular
 expression that matches the special character.  The ‘\’ character, when
@@ -999,9 +997,21 @@
 ‘\S’
      Match non-whitespace, it is a synonym for ‘[^[:space:]]’.
 
+‘\]’
+     Match ‘]’.
+
+‘\}’
+     Match ‘}’.
+
    For example, ‘\brat\b’ matches the separate word ‘rat’, 
‘\Brat\B’
 matches ‘crate’ but not ‘furry rat’.
 
+   The behavior of ‘grep’ is unspecified if a unescaped backslash is not
+followed by a special character, a nonzero digit, or a character in the
+above list.  Although ‘grep’ might issue a diagnostic and/or give the
+backslash an interpretation now, its behavior may change if the syntax
+of regular expressions is extended in future versions.
+
 3.4 Anchoring
 =============
 
@@ -1029,40 +1039,142 @@
 3.6 Basic vs Extended Regular Expressions
 =========================================
 
-In basic regular expressions the characters ‘?’, ‘+’, ‘{’, 
‘|’, ‘(’, and
-‘)’ lose their special meaning; instead use the backslashed versions
-‘\?’, ‘\+’, ‘\{’, ‘\|’, ‘\(’, and ‘\)’.  Also, a 
backslash is needed
-before an interval expression’s closing ‘}’, and an unmatched ‘\)’ is
+Basic regular expressions differ from extended regular expressions in
+the following ways:
+
+   • The characters ‘?’, ‘+’, ‘{’, ‘|’, ‘(’, and ‘)’ 
lose their special
+     meaning; instead use the backslashed versions ‘\?’, ‘\+’, 
‘\{’,
+     ‘\|’, ‘\(’, and ‘\)’.  Also, a backslash is needed before an
+     interval expression’s closing ‘}’.
+
+   • An unmatched ‘\)’ is invalid.
+
+   • If an unescaped ‘^’ appears neither first, nor directly after 
‘\(’
+     or ‘\|’, it is treated like an ordinary character and is not an
+     anchor.
+
+   • If an unescaped ‘$’ appears neither last, nor directly before 
‘\|’
+     or ‘\)’, it is treated like an ordinary character and is not an
+     anchor.
+
+   • If an unescaped ‘*’ appears first, or appears directly after 
‘\(’
+     or ‘\|’ or anchoring ‘^’, it is treated like an ordinary character
+     and is not a repetition operator.
+
+3.7 Problematic Regular Expressions
+===================================
+
+Some strings are “invalid regular expressions” and cause ‘grep’ to 
issue
+a diagnostic and fail.  For example, ‘xy\1’ is invalid because there is
+no parenthesized subexpression for the back-reference ‘\1’ to refer to.
+
+   Also, some regular expressions have “unspecified behavior” and should
+be avoided even if ‘grep’ does not currently diagnose them.  For
+example, ‘xy\0’ has unspecified behavior because ‘0’ is not a special
+character and ‘\0’ is not a special backslash expression (*note Special
+Backslash Expressions::).  Unspecified behavior can be particularly
+problematic because the set of matched strings might be only partially
+specified, or not be specified at all, or the expression might even be
 invalid.
 
-   Portable scripts should avoid the following constructs, as POSIX says
-they produce undefined results:
+   The following regular expression constructs are invalid on all
+platforms conforming to POSIX, so portable scripts can assume that
+‘grep’ rejects these constructs:
+
+   • A basic regular expression containing a back-reference ‘\N’
+     preceded by fewer than N closing parentheses.  For example,
+     ‘\(a\)\2’ is invalid.
+
+   • A bracket expression containing ‘[:’ that does not start a
+     character class; and similarly for ‘[=’ and ‘[.’.  For example,
+     ‘[a[:b]’ and ‘[a[:ouch:]b]’ are invalid.
+
+   GNU ‘grep’ treats the following constructs as invalid.  However,
+other ‘grep’ implementations might allow them, so portable scripts
+should not rely on their being invalid:
+
+   • Unescaped ‘\’ at the end of a regular expression.
+
+   • Unescaped ‘[’ that does not start a bracket expression.
 
-   • Extended regular expressions that use back-references.
-   • Basic regular expressions that use ‘\?’, ‘\+’, or ‘\|’.
-   • Empty parenthesized regular expressions like ‘()’.
-   • Empty alternatives (as in, e.g, ‘a|’).
-   • Repetition operators that immediately follow empty expressions,
-     unescaped ‘$’, or other repetition operators.
-   • A backslash escaping an ordinary character (e.g., ‘\S’), unless it
-     is a back-reference.
-   • An unescaped ‘[’ that is not part of a bracket expression.
-   • In extended regular expressions, an unescaped ‘{’ that is not part
-     of an interval expression.
-
-   Traditional ‘egrep’ did not support interval expressions and some
-‘egrep’ implementations use ‘\{’ and ‘\}’ instead, so portable 
scripts
-should avoid interval expressions in ‘grep -E’ patterns and should use
-‘[{]’ to match a literal ‘{’.
-
-   GNU ‘grep -E’ attempts to support traditional usage by assuming that
-‘{’ is not special if it would be the start of an invalid interval
-expression.  For example, the command ‘grep -E '{1'’ searches for the
-two-character string ‘{1’ instead of reporting a syntax error in the
-regular expression.  POSIX allows this behavior as an extension, but
-portable scripts should avoid it.
+   • A ‘\{’ in a basic regular expression that does not start an
+     interval expression.
 
-3.7 Character Encoding
+   • A basic regular expression with unbalanced ‘\(’ or ‘\)’, or an
+     extended regular expression with unbalanced ‘(’.
+
+   • In the POSIX locale, a range expression like ‘z-a’ that represents
+     zero elements.  A non-GNU ‘grep’ might treat it as a valid range
+     that never matches.
+
+   • An interval expression with a repetition count greater than 32767.
+     (The portable POSIX limit is 255, and even interval expressions
+     with smaller counts can be impractically slow on all known
+     implementations.)
+
+   • A bracket expression that contains at least three elements, the
+     first and last of which are both ‘:’, or both ‘.’, or both 
‘=’.
+     For example, a non-GNU ‘grep’ might treat ‘[:alpha:]’ like
+     ‘[[:alpha:]]’, or like ‘[:ahlp]’.
+
+   The following constructs have well-defined behavior in GNU ‘grep’.
+However, they have unspecified behavior elsewhere, so portable scripts
+should avoid them:
+
+   • Special backslash expressions like ‘\b’, ‘\<’, and ‘\]’.  
*Note
+     Special Backslash Expressions::.
+
+   • A basic regular expression that uses ‘\?’, ‘\+’, or ‘\|’.
+
+   • An extended regular expression that uses back-references.
+
+   • An empty regular expression, subexpression, or alternative.  For
+     example, ‘(a|bc|)’ is not portable; a portable equivalent is
+     ‘(a|bc)?’.
+
+   • In a basic regular expression, an anchoring ‘^’ that appears
+     directly after ‘\(’, or an anchoring ‘$’ that appears directly
+     before ‘\)’.
+
+   • In a basic regular expression, a repetition operator that directly
+     follows another repetition operator.
+
+   • In an extended regular expression, unescaped ‘{’ that does not
+     begin a valid interval expression.  GNU ‘grep’ treats the ‘{’ as 
an
+     ordinary character.
+
+   • A null character or an encoding error in either pattern or input
+     data.  *Note Character Encoding::.
+
+   • An input file that ends in a non-newline character, where GNU
+     ‘grep’ silently supplies a newline.
+
+   The following constructs have unspecified behavior, in both GNU and
+other ‘grep’ implementations.  Scripts should avoid them whenever
+possible.
+
+   • A backslash escaping an ordinary character, unless it is a
+     back-reference like ‘\1’ or a special backslash expression like
+     ‘\<’ or ‘\b’.  *Note Special Backslash Expressions::.  For 
example,
+     ‘\x’ has unspecified behavior now, and a future version of ‘grep’
+     might specify ‘\x’ to have a new behavior.
+
+   • A repetition operator that appears directly after an anchor, or at
+     the start of a complete regular expression, parenthesized
+     subexpression, or alternative.  For example, ‘+|^*(+a|?-b)’ has
+     unspecified behavior, whereas ‘\+|^\*(\+a|\?-b)’ is portable.
+
+   • A range expression outside the POSIX locale.  For example, in some
+     locales ‘[a-z]’ might match some characters that are not lowercase
+     letters, or might not match some lowercase letters, or might be
+     invalid.  With GNU ‘grep’ it is not documented whether these range
+     expressions use native code points, or use the collating sequence
+     specified by the ‘LC_COLLATE’ category, or have some other
+     interpretation.  Outside the POSIX locale, it is portable to use
+     ‘[[:lower:]]’ to match a lower-case letter, or
+     ‘[abcdefghijklmnopqrstuvwxyz]’ to match an ASCII lower-case letter.
+
+3.8 Character Encoding
 ======================
 
 The ‘LC_CTYPE’ locale specifies the encoding of characters in patterns
@@ -1087,7 +1199,7 @@
 and the 128 ASCII characters have their usual single-byte encodings on
 all but oddball platforms.
 
-3.8 Matching Non-ASCII and Non-printable Characters
+3.9 Matching Non-ASCII and Non-printable Characters
 ===================================================
 
 In a regular expression, non-ASCII and non-printable characters other
@@ -1179,19 +1291,29 @@
 
           grep -r --include='*.c' 'hello' /home/gigi
 
-  3. What if a pattern or file has a leading ‘-’?
+  3. What if a pattern or file has a leading ‘-’?  For example:
+
+          grep "$pattern" *
+
+     can behave unexpectedly if the value of ‘pattern’ begins with ‘-’,
+     or if the ‘*’ expands to a file name with leading ‘-’.  To avoid
+     the problem, you can use ‘-e’ for patterns and leading ‘./’ for
+     files:
+
+          grep -e "$pattern" ./*
 
-          grep -- '--cut here--' *
+     searches for all lines matching the pattern in all the working
+     directory’s files whose names do not begin with ‘.’.  Without the
+     ‘-e’, ‘grep’ might treat the pattern as an option if it begins 
with
+     ‘-’.  Without the ‘./’, there might be similar problems with file
+     names beginning with ‘-’.
 
-     searches for all lines matching ‘--cut here--’.  Without ‘--’,
-     ‘grep’ would attempt to parse ‘--cut here--’ as a list of options,
-     and there would be similar problems with any file names beginning
-     with ‘-’.
+     Alternatively, you can use ‘--’ before the pattern and file names:
 
-     Alternatively, you can prevent misinterpretation of leading ‘-’ by
-     using ‘-e’ for patterns and leading ‘./’ for files:
+          grep -- "$pattern" *
 
-          grep -e '--cut here--' ./*
+     This also fixes the problem, except that if there is a file named
+     ‘-’, ‘grep’ misinterprets the ‘-’ as standard input.
 
   4. Suppose I want to search for a whole word, not a part of a word?
 
@@ -1245,7 +1367,7 @@
      even from files that appear to be binary, use the ‘-a’ or
      ‘--binary-files=text’ option.  To eliminate the “Binary file
      matches” messages, use the ‘-I’ or 
‘--binary-files=without-match’
-     option, or the ‘-s’ or ‘--no-messages’ option.
+     option.
 
   9. Why doesn’t ‘grep -lv’ print non-matching file names?
 
@@ -1269,8 +1391,11 @@
      to match every line.
 
      To match empty lines, use the pattern ‘^$’.  To match blank lines,
-     use the pattern ‘^[[:blank:]]*$’.  To match no lines at all, use
-     the command ‘grep -f /dev/null’.
+     use the pattern ‘^[[:blank:]]*$’.  To match no lines at all, use an
+     extended regular expression like ‘a^’ or ‘$a’.  To match every
+     line, a portable script should use a pattern like ‘^’ instead of
+     the empty pattern, as POSIX does not specify the behavior of the
+     empty pattern.
 
   12. How can I search in both standard input and in files?
 
@@ -1278,14 +1403,28 @@
 
           cat /etc/passwd | grep 'alain' - /etc/motd
 
-  13. Why is this back-reference failing?
+  13. Why can’t I combine the shell’s ‘set -e’ with ‘grep’?
+
+     The ‘grep’ command follows the convention of programs like ‘cmp’
+     and ‘diff’ where an exit status of 1 is not an error.  The shell
+     command ‘set -e’ causes the shell to exit if any subcommand exits
+     with nonzero status, and this will cause the shell to exit merely
+     because ‘grep’ selected no lines, which is ordinarily not what you
+     want.
+
+     There is a related problem with Bash’s ‘set -e -o pipefail’.  Since
+     ‘grep’ does not always read all its input, a command outputting to
+     a pipe read by ‘grep’ can fail when ‘grep’ exits before reading 
all
+     its input, and the command’s failure can cause Bash to exit.
+
+  14. Why is this back-reference failing?
 
           echo 'ba' | grep -E '(a)\1|b\1'
 
      This outputs an error message, because the second ‘\1’ has nothing
      to refer back to, meaning it will never match anything.
 
-  14. How can I match across lines?
+  15. How can I match across lines?
 
      Standard grep cannot do this, as it is fundamentally line-based.
      Therefore, merely using the ‘[:space:]’ character class does not
@@ -1303,7 +1442,7 @@
      it to ‘grep’, or turn to ‘awk’, ‘sed’, ‘perl’, or many 
other
      utilities that are designed to operate across lines.
 
-  15. What do ‘grep’, ‘fgrep’, and ‘egrep’ stand for?
+  16. What do ‘grep’, ‘-E’, and ‘-F’ stand for?
 
      The name ‘grep’ comes from the way line editing was done on Unix.
      For example, ‘ed’ uses the following syntax to print a list of
@@ -1312,8 +1451,25 @@
           global/regular expression/print
           g/re/p
 
-     ‘fgrep’ stands for Fixed ‘grep’; ‘egrep’ stands for Extended
-     ‘grep’.
+     The ‘-E’ option stands for Extended ‘grep’.  The ‘-F’ option 
stands
+     for Fixed ‘grep’;
+
+  17. What happened to ‘egrep’ and ‘fgrep’?
+
+     7th Edition Unix had commands ‘egrep’ and ‘fgrep’ that were the
+     counterparts of the modern ‘grep -E’ and ‘grep -F’.  Although
+     breaking up ‘grep’ into three programs was perhaps useful on the
+     small computers of the 1970s, ‘egrep’ and ‘fgrep’ were not
+     standardized by POSIX and are no longer needed.  In the current GNU
+     implementation, ‘egrep’ and ‘fgrep’ issue a warning and then act
+     like their modern counterparts; eventually, they are planned to be
+     removed entirely.
+
+     If you prefer the old names, you can use use your own substitutes,
+     such as a shell script named ‘egrep’ with the following contents:
+
+          #!/bin/sh
+          exec grep -E "$@"
 
 5 Performance
 *************
@@ -1344,6 +1500,15 @@
 inefficient due to difficulties in fast portable access to concepts like
 multi-character collating elements.
 
+   Interval expressions may be implemented internally via repetition.
+For example, ‘^(a|bc){2,4}$’ might be implemented as
+‘^(a|bc)(a|bc)((a|bc)(a|bc)?)?$’.  A large repetition count may exhaust
+memory or greatly slow matching.  Even small counts can cause problems
+if cascaded; for example, ‘grep -E ".*{10,}{10,}{10,}{10,}{10,}"’ is
+likely to overflow a stack.  Fortunately, regular expressions like these
+are typically artificial, and cascaded repetitions do not conform to
+POSIX so cannot be used in portable programs anyway.
+
    A back-reference such as ‘\1’ can hurt performance significantly in
 some cases, since back-references cannot in general be implemented via a
 finite state automaton, and instead trigger a backtracking algorithm
@@ -1361,6 +1526,13 @@
 is used (*note File and Directory Selection::), unless the ‘-z’
 (‘--null-data’) option is also used (*note Other Options::).
 
+   For efficiency ‘grep’ does not always read all its input.  For
+example, the shell command ‘sed '/^...$/d' | grep -q X’ can cause 
‘grep’
+to exit immediately after reading a line containing ‘X’, without
+bothering to read the rest of its input data.  This in turn can cause
+‘sed’ to exit with a nonzero status because ‘sed’ cannot write to its
+output pipe after ‘grep’ exits.
+
    For more about the algorithms used by ‘grep’ and about related string
 matching algorithms, see:
 
@@ -1371,19 +1543,31 @@
 
    • Aho AV, Corasick MJ. Efficient string matching: an aid to
      bibliographic search. _CACM_. 1975;18(6):333–40.
-     <https://dx.doi.org/10.1145/360825.360855>. This introduces the
+     <https://doi.org/10.1145/360825.360855>. This introduces the
      Aho–Corasick algorithm.
 
    • Boyer RS, Moore JS. A fast string searching algorithm. _CACM_.
-     1977;20(10):762–72. <https://dx.doi.org/10.1145/359842.359859>.
-     This introduces the Boyer–Moore algorithm.
+     1977;20(10):762–72. <https://doi.org/10.1145/359842.359859>. This
+     introduces the Boyer–Moore algorithm.
 
    • Faro S, Lecroq T. The exact online string matching problem: a
      review of the most recent results. _ACM Comput Surv_.
-     2013;45(2):13. <https://dx.doi.org/10.1145/2431211.2431212>. This
+     2013;45(2):13. <https://doi.org/10.1145/2431211.2431212>. This
      surveys string matching algorithms that might help improve the
      performance of ‘grep’ in the future.
 
+   • Hakak SI, Kamsin A, Shivakumara P, Gilkar GA, Khan WZ, Imran M.
+     Exact string matching algorithms: survey issues, and future
+     research directions. _IEEE Access_. 2019;7:69614–37.
+     <https://doi.org/10.1109/ACCESS.2019.2914071>. This survey is more
+     recent than Faro & Lecroq, and focuses on taxonomy instead of
+     performance.
+
+   • Hume A, Sunday D. Fast string search. _Software Pract Exper_.
+     1991;21(11):1221–48. <https://doi.org/10.1002/spe.4380211105>. This
+     excellent albeit now-dated survey aided the initial development of
+     ‘grep’.
+
 6 Reporting bugs
 ****************
 
@@ -1920,482 +2104,491 @@
 * Menu:
 
 * *:                                     Fundamental Structure.
-                                                             (line  817)
+                                                             (line  811)
 * +:                                     Fundamental Structure.
-                                                             (line  820)
-* --:                                    Other Options.      (line  497)
+                                                             (line  814)
+* --:                                    Other Options.      (line  498)
 * --after-context:                       Context Line Control.
-                                                             (line  339)
+                                                             (line  340)
 * --basic-regexp:                        grep Programs.      (line  754)
 * --before-context:                      Context Line Control.
-                                                             (line  343)
-* --binary:                              Other Options.      (line  512)
+                                                             (line  344)
+* --binary:                              Other Options.      (line  513)
 * --binary-files:                        File and Directory Selection.
-                                                             (line  389)
+                                                             (line  390)
 * --byte-offset:                         Output Line Prefix Control.
-                                                             (line  280)
+                                                             (line  281)
 * --color:                               General Output Control.
-                                                             (line  187)
+                                                             (line  188)
 * --colour:                              General Output Control.
-                                                             (line  187)
+                                                             (line  188)
 * --context:                             Context Line Control.
-                                                             (line  348)
+                                                             (line  349)
 * --count:                               General Output Control.
-                                                             (line  181)
+                                                             (line  182)
 * --dereference-recursive:               File and Directory Selection.
-                                                             (line  490)
+                                                             (line  491)
 * --devices:                             File and Directory Selection.
-                                                             (line  428)
+                                                             (line  429)
 * --directories:                         File and Directory Selection.
-                                                             (line  439)
+                                                             (line  440)
 * --exclude:                             File and Directory Selection.
-                                                             (line  450)
+                                                             (line  451)
 * --exclude-dir:                         File and Directory Selection.
-                                                             (line  464)
+                                                             (line  465)
 * --exclude-from:                        File and Directory Selection.
-                                                             (line  460)
+                                                             (line  461)
 * --extended-regexp:                     grep Programs.      (line  759)
-* --file:                                Matching Control.   (line  115)
+* --file:                                Matching Control.   (line  116)
 * --files-with-matches:                  General Output Control.
-                                                             (line  207)
+                                                             (line  212)
 * --files-without-match:                 General Output Control.
-                                                             (line  202)
+                                                             (line  207)
 * --fixed-strings:                       grep Programs.      (line  764)
 * --group-separator:                     Context Line Control.
-                                                             (line  351)
+                                                             (line  352)
 * --group-separator <1>:                 Context Line Control.
-                                                             (line  355)
+                                                             (line  356)
 * --help:                                Generic Program Information.
-                                                             (line   93)
-* --ignore-case:                         Matching Control.   (line  124)
+                                                             (line   94)
+* --ignore-case:                         Matching Control.   (line  125)
 * --include:                             File and Directory Selection.
-                                                             (line  474)
+                                                             (line  475)
 * --initial-tab:                         Output Line Prefix Control.
-                                                             (line  309)
-* --invert-match:                        Matching Control.   (line  149)
+                                                             (line  310)
+* --invert-match:                        Matching Control.   (line  150)
 * --label:                               Output Line Prefix Control.
-                                                             (line  296)
-* --line-buffered:                       Other Options.      (line  503)
+                                                             (line  297)
+* --line-buffered:                       Other Options.      (line  504)
 * --line-number:                         Output Line Prefix Control.
-                                                             (line  304)
-* --line-regexp:                         Matching Control.   (line  171)
+                                                             (line  305)
+* --line-regexp:                         Matching Control.   (line  172)
 * --max-count:                           General Output Control.
-                                                             (line  213)
+                                                             (line  218)
 * --no-filename:                         Output Line Prefix Control.
-                                                             (line  291)
-* --no-ignore-case:                      Matching Control.   (line  142)
+                                                             (line  292)
+* --no-ignore-case:                      Matching Control.   (line  143)
 * --no-messages:                         General Output Control.
-                                                             (line  258)
+                                                             (line  269)
 * --null:                                Output Line Prefix Control.
-                                                             (line  318)
-* --null-data:                           Other Options.      (line  533)
+                                                             (line  319)
+* --null-data:                           Other Options.      (line  534)
 * --only-matching:                       General Output Control.
-                                                             (line  243)
+                                                             (line  252)
 * --perl-regexp:                         grep Programs.      (line  769)
 * --quiet:                               General Output Control.
-                                                             (line  251)
+                                                             (line  260)
 * --recursive:                           File and Directory Selection.
-                                                             (line  482)
-* --regexp=PATTERNS:                     Matching Control.   (line  106)
+                                                             (line  483)
+* --regexp=PATTERNS:                     Matching Control.   (line  107)
 * --silent:                              General Output Control.
-                                                             (line  251)
+                                                             (line  260)
 * --text:                                File and Directory Selection.
-                                                             (line  385)
+                                                             (line  386)
 * --version:                             Generic Program Information.
-                                                             (line   98)
+                                                             (line   99)
 * --with-filename:                       Output Line Prefix Control.
-                                                             (line  286)
-* --word-regexp:                         Matching Control.   (line  154)
+                                                             (line  287)
+* --word-regexp:                         Matching Control.   (line  155)
 * -A:                                    Context Line Control.
-                                                             (line  339)
+                                                             (line  340)
 * -a:                                    File and Directory Selection.
-                                                             (line  385)
+                                                             (line  386)
 * -b:                                    Output Line Prefix Control.
-                                                             (line  280)
+                                                             (line  281)
 * -B:                                    Context Line Control.
-                                                             (line  343)
+                                                             (line  344)
 * -c:                                    General Output Control.
-                                                             (line  181)
+                                                             (line  182)
 * -C:                                    Context Line Control.
-                                                             (line  348)
+                                                             (line  349)
 * -D:                                    File and Directory Selection.
-                                                             (line  428)
+                                                             (line  429)
 * -d:                                    File and Directory Selection.
-                                                             (line  439)
-* -e:                                    Matching Control.   (line  106)
+                                                             (line  440)
+* -e:                                    Matching Control.   (line  107)
 * -E:                                    grep Programs.      (line  759)
-* -f:                                    Matching Control.   (line  115)
+* -f:                                    Matching Control.   (line  116)
 * -F:                                    grep Programs.      (line  764)
 * -G:                                    grep Programs.      (line  754)
 * -H:                                    Output Line Prefix Control.
-                                                             (line  286)
+                                                             (line  287)
 * -h:                                    Output Line Prefix Control.
-                                                             (line  291)
-* -i:                                    Matching Control.   (line  124)
+                                                             (line  292)
+* -i:                                    Matching Control.   (line  125)
 * -L:                                    General Output Control.
-                                                             (line  202)
-* -l:                                    General Output Control.
                                                              (line  207)
+* -l:                                    General Output Control.
+                                                             (line  212)
 * -m:                                    General Output Control.
-                                                             (line  213)
+                                                             (line  218)
 * -n:                                    Output Line Prefix Control.
-                                                             (line  304)
+                                                             (line  305)
 * -NUM:                                  Context Line Control.
-                                                             (line  348)
+                                                             (line  349)
 * -o:                                    General Output Control.
-                                                             (line  243)
+                                                             (line  252)
 * -P:                                    grep Programs.      (line  769)
 * -q:                                    General Output Control.
-                                                             (line  251)
+                                                             (line  260)
 * -r:                                    File and Directory Selection.
-                                                             (line  482)
+                                                             (line  483)
 * -R:                                    File and Directory Selection.
-                                                             (line  490)
+                                                             (line  491)
 * -s:                                    General Output Control.
-                                                             (line  258)
+                                                             (line  269)
 * -T:                                    Output Line Prefix Control.
-                                                             (line  309)
-* -U:                                    Other Options.      (line  512)
+                                                             (line  310)
+* -U:                                    Other Options.      (line  513)
 * -V:                                    Generic Program Information.
-                                                             (line   98)
-* -v:                                    Matching Control.   (line  149)
-* -w:                                    Matching Control.   (line  154)
-* -x:                                    Matching Control.   (line  171)
-* -y:                                    Matching Control.   (line  124)
+                                                             (line   99)
+* -v:                                    Matching Control.   (line  150)
+* -w:                                    Matching Control.   (line  155)
+* -x:                                    Matching Control.   (line  172)
+* -y:                                    Matching Control.   (line  125)
 * -Z:                                    Output Line Prefix Control.
-                                                             (line  318)
-* -z:                                    Other Options.      (line  533)
+                                                             (line  319)
+* -z:                                    Other Options.      (line  534)
 * .:                                     Fundamental Structure.
-                                                             (line  806)
+                                                             (line  800)
 * ?:                                     Fundamental Structure.
-                                                             (line  814)
+                                                             (line  808)
 * _N_GNU_nonoption_argv_flags_ environment variable: Environment Variables.
                                                              (line  713)
 * {,M}:                                  Fundamental Structure.
-                                                             (line  829)
+                                                             (line  823)
 * {N,M}:                                 Fundamental Structure.
-                                                             (line  833)
+                                                             (line  827)
 * {N,}:                                  Fundamental Structure.
-                                                             (line  826)
+                                                             (line  820)
 * {N}:                                   Fundamental Structure.
-                                                             (line  823)
+                                                             (line  817)
 * after context:                         Context Line Control.
-                                                             (line  339)
+                                                             (line  340)
 * alnum character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  878)
+                                                             (line  876)
 * alpha character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  883)
+                                                             (line  881)
 * alphabetic characters:                 Character Classes and Bracket 
Expressions.
-                                                             (line  883)
+                                                             (line  881)
 * alphanumeric characters:               Character Classes and Bracket 
Expressions.
-                                                             (line  878)
-* anchoring:                             Anchoring.          (line 1007)
+                                                             (line  876)
+* alternatives in regular expressions:   Fundamental Structure.
+                                                             (line  835)
+* anchoring:                             Anchoring.          (line 1017)
 * asterisk:                              Fundamental Structure.
-                                                             (line  817)
+                                                             (line  811)
 * back-reference:                        Back-references and Subexpressions.
-                                                             (line 1015)
-* back-references:                       Performance.        (line 1346)
-* backslash:                             The Backslash Character and Special 
Expressions.
-                                                             (line  973)
-* basic regular expressions:             Basic vs Extended.  (line 1031)
+                                                             (line 1025)
+* back-references:                       Performance.        (line 1511)
+* backslash:                             Special Backslash Expressions.
+                                                             (line  971)
+* basic regular expressions:             Basic vs Extended.  (line 1041)
 * before context:                        Context Line Control.
-                                                             (line  343)
+                                                             (line  344)
 * binary files:                          File and Directory Selection.
-                                                             (line  385)
+                                                             (line  386)
 * binary files <1>:                      File and Directory Selection.
-                                                             (line  389)
-* binary I/O:                            Other Options.      (line  512)
+                                                             (line  390)
+* binary I/O:                            Other Options.      (line  513)
 * blank character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  888)
+                                                             (line  886)
 * blank characters:                      Character Classes and Bracket 
Expressions.
-                                                             (line  888)
+                                                             (line  886)
 * bn GREP_COLORS capability:             Environment Variables.
-                                                             (line  656)
+                                                             (line  654)
 * braces, first argument omitted:        Fundamental Structure.
-                                                             (line  829)
-* braces, one argument:                  Fundamental Structure.
                                                              (line  823)
+* braces, one argument:                  Fundamental Structure.
+                                                             (line  817)
 * braces, second argument omitted:       Fundamental Structure.
-                                                             (line  826)
+                                                             (line  820)
 * braces, two arguments:                 Fundamental Structure.
-                                                             (line  833)
+                                                             (line  827)
 * bracket expression:                    Character Classes and Bracket 
Expressions.
-                                                             (line  853)
-* Bugs, known:                           Known Bugs.         (line 1397)
-* bugs, reporting:                       Reporting Bugs.     (line 1389)
+                                                             (line  850)
+* Bugs, known:                           Known Bugs.         (line 1581)
+* bugs, reporting:                       Reporting Bugs.     (line 1573)
 * byte offset:                           Output Line Prefix Control.
-                                                             (line  280)
-* case insensitive search:               Matching Control.   (line  124)
-* case insensitive search <1>:           Performance.        (line 1341)
+                                                             (line  281)
+* case insensitive search:               Matching Control.   (line  125)
+* case insensitive search <1>:           Performance.        (line 1497)
 * changing name of standard input:       Output Line Prefix Control.
-                                                             (line  296)
+                                                             (line  297)
 * character class:                       Character Classes and Bracket 
Expressions.
-                                                             (line  853)
+                                                             (line  850)
 * character classes:                     Character Classes and Bracket 
Expressions.
-                                                             (line  877)
-* character encoding:                    Character Encoding. (line 1067)
+                                                             (line  875)
+* character encoding:                    Character Encoding. (line 1179)
 * character type:                        Environment Variables.
-                                                             (line  683)
+                                                             (line  681)
 * classes of characters:                 Character Classes and Bracket 
Expressions.
-                                                             (line  877)
+                                                             (line  875)
 * cntrl character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  891)
+                                                             (line  889)
 * context lines:                         General Output Control.
-                                                             (line  235)
+                                                             (line  244)
 * context lines <1>:                     Context Line Control.
-                                                             (line  330)
+                                                             (line  331)
 * context lines <2>:                     Context Line Control.
-                                                             (line  348)
+                                                             (line  349)
 * context lines, after match:            Context Line Control.
-                                                             (line  339)
+                                                             (line  340)
 * context lines, before match:           Context Line Control.
-                                                             (line  343)
+                                                             (line  344)
 * control characters:                    Character Classes and Bracket 
Expressions.
-                                                             (line  891)
-* copying:                               Copying.            (line 1417)
+                                                             (line  889)
+* copying:                               Copying.            (line 1601)
 * counting lines:                        General Output Control.
-                                                             (line  181)
+                                                             (line  182)
 * cx GREP_COLORS capability:             Environment Variables.
-                                                             (line  607)
+                                                             (line  605)
 * device search:                         File and Directory Selection.
-                                                             (line  428)
+                                                             (line  429)
 * digit character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  896)
+                                                             (line  894)
 * digit characters:                      Character Classes and Bracket 
Expressions.
-                                                             (line  896)
+                                                             (line  894)
 * directory search:                      File and Directory Selection.
-                                                             (line  439)
+                                                             (line  440)
 * dot:                                   Fundamental Structure.
-                                                             (line  806)
+                                                             (line  800)
 * encoding error:                        Environment Variables.
-                                                             (line  690)
+                                                             (line  688)
 * environment variables:                 Environment Variables.
-                                                             (line  579)
+                                                             (line  560)
 * exclude directories:                   File and Directory Selection.
-                                                             (line  464)
+                                                             (line  465)
 * exclude files:                         File and Directory Selection.
-                                                             (line  450)
+                                                             (line  451)
 * exclude files <1>:                     File and Directory Selection.
-                                                             (line  460)
+                                                             (line  461)
 * exit status:                           Exit Status.        (line  736)
-* FAQ about grep usage:                  Usage.              (line 1151)
+* FAQ about grep usage:                  Usage.              (line 1263)
 * files which don’t match:               General Output Control.
-                                                             (line  202)
+                                                             (line  207)
 * fn GREP_COLORS capability:             Environment Variables.
-                                                             (line  646)
+                                                             (line  644)
 * fn GREP_COLORS capability <1>:         Environment Variables.
-                                                             (line  661)
+                                                             (line  659)
 * graph character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  899)
+                                                             (line  897)
 * graphic characters:                    Character Classes and Bracket 
Expressions.
-                                                             (line  899)
+                                                             (line  897)
 * grep programs:                         grep Programs.      (line  745)
 * GREP_COLOR environment variable:       Environment Variables.
-                                                             (line  580)
+                                                             (line  563)
 * GREP_COLORS environment variable:      Environment Variables.
-                                                             (line  591)
+                                                             (line  569)
 * group separator:                       Context Line Control.
-                                                             (line  351)
+                                                             (line  352)
 * group separator <1>:                   Context Line Control.
-                                                             (line  355)
+                                                             (line  356)
 * hexadecimal digits:                    Character Classes and Bracket 
Expressions.
-                                                             (line  923)
+                                                             (line  921)
 * highlight markers:                     Environment Variables.
-                                                             (line  580)
+                                                             (line  563)
 * highlight markers <1>:                 Environment Variables.
-                                                             (line  591)
+                                                             (line  569)
 * highlight, color, colour:              General Output Control.
-                                                             (line  187)
-* holes in files:                        Performance.        (line 1356)
+                                                             (line  188)
+* holes in files:                        Performance.        (line 1521)
 * include files:                         File and Directory Selection.
-                                                             (line  474)
+                                                             (line  475)
 * interval expressions:                  Fundamental Structure.
-                                                             (line  809)
-* interval expressions <1>:              Basic vs Extended.  (line 1052)
-* invert matching:                       Matching Control.   (line  149)
+                                                             (line  803)
+* interval expressions <1>:              Performance.        (line 1502)
+* invalid regular expressions:           Problematic Expressions.
+                                                             (line 1066)
+* invert matching:                       Matching Control.   (line  150)
 * LANG environment variable:             Environment Variables.
-                                                             (line  544)
+                                                             (line  546)
 * LANG environment variable <1>:         Environment Variables.
-                                                             (line  683)
+                                                             (line  681)
 * LANG environment variable <2>:         Environment Variables.
-                                                             (line  690)
+                                                             (line  688)
 * LANG environment variable <3>:         Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
 * LANGUAGE environment variable:         Environment Variables.
-                                                             (line  544)
+                                                             (line  546)
 * LANGUAGE environment variable <1>:     Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
 * language of messages:                  Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
 * LC_ALL environment variable:           Environment Variables.
-                                                             (line  544)
+                                                             (line  546)
 * LC_ALL environment variable <1>:       Environment Variables.
-                                                             (line  683)
+                                                             (line  681)
 * LC_ALL environment variable <2>:       Environment Variables.
-                                                             (line  690)
+                                                             (line  688)
 * LC_ALL environment variable <3>:       Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
 * LC_COLLATE environment variable:       Environment Variables.
-                                                             (line  683)
+                                                             (line  681)
 * LC_CTYPE environment variable:         Environment Variables.
-                                                             (line  690)
+                                                             (line  688)
 * LC_MESSAGES environment variable:      Environment Variables.
-                                                             (line  544)
+                                                             (line  546)
 * LC_MESSAGES environment variable <1>:  Environment Variables.
-                                                             (line  699)
-* line buffering:                        Other Options.      (line  503)
+                                                             (line  697)
+* line buffering:                        Other Options.      (line  504)
 * line numbering:                        Output Line Prefix Control.
-                                                             (line  304)
+                                                             (line  305)
 * ln GREP_COLORS capability:             Environment Variables.
-                                                             (line  651)
-* locales:                               Performance.        (line 1334)
+                                                             (line  649)
+* locales:                               Performance.        (line 1490)
 * lower character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  902)
+                                                             (line  900)
 * lower-case letters:                    Character Classes and Bracket 
Expressions.
-                                                             (line  902)
+                                                             (line  900)
 * match expression at most M times:      Fundamental Structure.
-                                                             (line  829)
+                                                             (line  823)
 * match expression at most once:         Fundamental Structure.
-                                                             (line  814)
+                                                             (line  808)
 * match expression from N to M times:    Fundamental Structure.
-                                                             (line  833)
+                                                             (line  827)
 * match expression N or more times:      Fundamental Structure.
-                                                             (line  826)
+                                                             (line  820)
 * match expression N times:              Fundamental Structure.
-                                                             (line  823)
+                                                             (line  817)
 * match expression one or more times:    Fundamental Structure.
-                                                             (line  820)
+                                                             (line  814)
 * match expression zero or more times:   Fundamental Structure.
-                                                             (line  817)
-* match the whole line:                  Matching Control.   (line  171)
+                                                             (line  811)
+* match the whole line:                  Matching Control.   (line  172)
 * matching basic regular expressions:    grep Programs.      (line  754)
 * matching extended regular expressions: grep Programs.      (line  759)
 * matching fixed strings:                grep Programs.      (line  764)
 * matching Perl-compatible regular expressions: grep Programs.
                                                              (line  769)
-* matching whole words:                  Matching Control.   (line  154)
+* matching whole words:                  Matching Control.   (line  155)
 * max-count:                             General Output Control.
-                                                             (line  213)
+                                                             (line  218)
 * mc GREP_COLORS capability:             Environment Variables.
-                                                             (line  638)
+                                                             (line  636)
 * message language:                      Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
 * ms GREP_COLORS capability:             Environment Variables.
-                                                             (line  630)
-* MS-Windows binary I/O:                 Other Options.      (line  512)
+                                                             (line  628)
+* MS-Windows binary I/O:                 Other Options.      (line  513)
 * mt GREP_COLORS capability:             Environment Variables.
-                                                             (line  622)
+                                                             (line  620)
 * names of matching files:               General Output Control.
-                                                             (line  207)
+                                                             (line  212)
 * national language support:             Environment Variables.
-                                                             (line  683)
+                                                             (line  681)
 * national language support <1>:         Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
 * ne GREP_COLORS capability:             Environment Variables.
-                                                             (line  668)
+                                                             (line  666)
 * NLS:                                   Environment Variables.
-                                                             (line  683)
+                                                             (line  681)
 * no filename prefix:                    Output Line Prefix Control.
-                                                             (line  291)
-* non-ASCII matching:                    Matching Non-ASCII. (line 1092)
-* non-printable matching:                Matching Non-ASCII. (line 1092)
+                                                             (line  292)
+* non-ASCII matching:                    Matching Non-ASCII. (line 1204)
+* non-printable matching:                Matching Non-ASCII. (line 1204)
 * null character:                        Environment Variables.
-                                                             (line  690)
+                                                             (line  688)
 * numeric characters:                    Character Classes and Bracket 
Expressions.
-                                                             (line  896)
+                                                             (line  894)
 * only matching:                         General Output Control.
-                                                             (line  243)
-* option delimiter:                      Other Options.      (line  497)
+                                                             (line  252)
+* option delimiter:                      Other Options.      (line  498)
 * ordinary characters:                   Fundamental Structure.
-                                                             (line  801)
-* patterns from file:                    Matching Control.   (line  115)
-* patterns option:                       Matching Control.   (line  106)
-* performance:                           Performance.        (line 1320)
+                                                             (line  795)
+* patterns from file:                    Matching Control.   (line  116)
+* patterns option:                       Matching Control.   (line  107)
+* performance:                           Performance.        (line 1476)
 * period:                                Fundamental Structure.
-                                                             (line  806)
+                                                             (line  800)
+* pipelines and reading:                 Performance.        (line 1528)
 * plus sign:                             Fundamental Structure.
-                                                             (line  820)
+                                                             (line  814)
 * POSIXLY_CORRECT environment variable:  Environment Variables.
-                                                             (line  704)
+                                                             (line  702)
 * print character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  906)
-* print non-matching lines:              Matching Control.   (line  149)
+                                                             (line  904)
+* print non-matching lines:              Matching Control.   (line  150)
 * printable characters:                  Character Classes and Bracket 
Expressions.
-                                                             (line  906)
+                                                             (line  904)
 * punct character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  909)
+                                                             (line  907)
 * punctuation characters:                Character Classes and Bracket 
Expressions.
-                                                             (line  909)
+                                                             (line  907)
 * question mark:                         Fundamental Structure.
-                                                             (line  814)
+                                                             (line  808)
 * quiet, silent:                         General Output Control.
-                                                             (line  251)
+                                                             (line  260)
 * range expression:                      Character Classes and Bracket 
Expressions.
-                                                             (line  861)
+                                                             (line  858)
 * recursive search:                      File and Directory Selection.
-                                                             (line  482)
+                                                             (line  483)
 * recursive search <1>:                  File and Directory Selection.
-                                                             (line  490)
+                                                             (line  491)
 * regular expressions:                   Regular Expressions.
-                                                             (line  784)
+                                                             (line  778)
 * return status:                         Exit Status.        (line  736)
 * rv GREP_COLORS capability:             Environment Variables.
-                                                             (line  616)
+                                                             (line  614)
 * searching directory trees:             File and Directory Selection.
-                                                             (line  450)
+                                                             (line  451)
 * searching directory trees <1>:         File and Directory Selection.
-                                                             (line  460)
+                                                             (line  461)
 * searching directory trees <2>:         File and Directory Selection.
-                                                             (line  474)
+                                                             (line  475)
 * searching directory trees <3>:         File and Directory Selection.
-                                                             (line  482)
+                                                             (line  483)
 * searching directory trees <4>:         File and Directory Selection.
-                                                             (line  490)
-* searching for patterns:                Introduction.       (line   51)
+                                                             (line  491)
+* searching for patterns:                Introduction.       (line   52)
 * sl GREP_COLORS capability:             Environment Variables.
-                                                             (line  599)
+                                                             (line  597)
 * space character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  914)
+                                                             (line  912)
 * space characters:                      Character Classes and Bracket 
Expressions.
-                                                             (line  914)
+                                                             (line  912)
 * special characters:                    Fundamental Structure.
-                                                             (line  801)
+                                                             (line  795)
 * subexpression:                         Back-references and Subexpressions.
-                                                             (line 1015)
+                                                             (line 1025)
 * suppress binary data:                  File and Directory Selection.
-                                                             (line  385)
+                                                             (line  386)
 * suppress error messages:               General Output Control.
-                                                             (line  258)
+                                                             (line  269)
 * symbolic links:                        File and Directory Selection.
-                                                             (line  439)
+                                                             (line  440)
 * symbolic links <1>:                    File and Directory Selection.
-                                                             (line  482)
+                                                             (line  483)
 * symbolic links <2>:                    File and Directory Selection.
-                                                             (line  490)
+                                                             (line  491)
 * tab-aligned content lines:             Output Line Prefix Control.
-                                                             (line  309)
+                                                             (line  310)
+* TERM environment variable:             Environment Variables.
+                                                             (line  709)
 * translation of message language:       Environment Variables.
-                                                             (line  699)
+                                                             (line  697)
+* unspecified behavior in regular expressions: Problematic Expressions.
+                                                             (line 1066)
 * upper character class:                 Character Classes and Bracket 
Expressions.
-                                                             (line  919)
+                                                             (line  917)
 * upper-case letters:                    Character Classes and Bracket 
Expressions.
-                                                             (line  919)
+                                                             (line  917)
 * usage summary, printing:               Generic Program Information.
-                                                             (line   93)
-* usage, examples:                       Usage.              (line 1125)
-* using grep, Q&A:                       Usage.              (line 1151)
+                                                             (line   94)
+* usage, examples:                       Usage.              (line 1237)
+* using grep, Q&A:                       Usage.              (line 1263)
 * variants of grep:                      grep Programs.      (line  745)
 * version, printing:                     Generic Program Information.
-                                                             (line   98)
+                                                             (line   99)
 * whitespace characters:                 Character Classes and Bracket 
Expressions.
-                                                             (line  914)
+                                                             (line  912)
 * with filename prefix:                  Output Line Prefix Control.
-                                                             (line  286)
+                                                             (line  287)
 * xdigit character class:                Character Classes and Bracket 
Expressions.
-                                                             (line  923)
+                                                             (line  921)
 * xdigit class:                          Character Classes and Bracket 
Expressions.
-                                                             (line  923)
+                                                             (line  921)
 * zero-terminated file names:            Output Line Prefix Control.
-                                                             (line  318)
-* zero-terminated lines:                 Other Options.      (line  533)
+                                                             (line  319)
+* zero-terminated lines:                 Other Options.      (line  534)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]