• Home
  • Raw
  • Download

Lines Matching full:is

29 slashes, as is common in Perl scripts), they are interpreted as part of the
34 The first argument that follows any option settings is treated as the single
35 pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present.
47 pattern is copied to the standard output, and if there is more than one file,
48 the file name is output at the start of each line, followed by a colon.
51 span line boundaries. What defines a line boundary is controlled by the
54 The amount of memory used for buffering files that are being scanned is
57 that is obtained at the start of processing. If an input file contains very
58 long lines, a larger buffer may be needed; this is handled by automatically
60 default values for these parameters can be set when \fBpcre2grep\fP is
61 built; if nothing is specified, the defaults are set to 20KiB and 1MiB
62 respectively. An error occurs if a line is too long and the buffer can no
65 The block of memory that is actually used is three times the "buffer size", to
66 allow for buffering "before" and "after" lines. If the buffer size is too
69 Patterns can be no longer than 8KiB or BUFSIZ bytes, whichever is the greater.
70 BUFSIZ is defined in \fB<stdio.h>\fP. When there is more than one pattern
71 (specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to
76 considered. However, if \fB--colour\fP (or \fB--color\fP) is used to colour the
78 \fB--line-offsets\fP is used to output only the part of the line that matched
86 can affect the output when one of the above options is used. This is no longer
88 for later patterns (as long as there is no overlap).
91 matches are never recognized. An example is the pattern "(super)?(man)?", in
96 If the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variable is set,
104 It is possible to compile \fBpcre2grep\fP so that it uses \fBlibz\fP or
108 \fB--help\fP option. If the appropriate support is not present, all files are
109 treated as plain text. The standard input is always so treated. When input is
110 from a compressed .gz or .bz2 file, the \fB--line-buffered\fP option is
118 is identified as a binary file, and is processed specially. (GNU grep
119 identifies binary files in this manner.) However, if the newline type is
120 specified as "nul", that is, the line terminator is a binary zero, the test for
121 a binary file is not applied. See the \fB--binary-files\fP option for a means
139 effect. Similarly, except where noted below, if an option is given twice, the
140 later setting is used. Numerical values for options may be followed by K or M,
144 This terminates the list of options. It is useful if the next item on the
145 command line starts with a hyphen but is not an option. This allows for the
150 lines are output if the next match or the end of the file is reached, or if the
152 numbers are being output, a hyphen separator is used instead of a colon for the
153 context lines. A line containing "--" is output between each group of lines,
155 is expected to be relatively small. When \fB-c\fP is used, \fB-A\fP is ignored.
158 Treat binary files as text. This is equivalent to
163 lines are output if the previous match or the start of the file is within
165 file names and/or line numbers are being output, a hyphen separator is used
166 instead of a colon for the context lines. A line containing "--" is output
168 file. The value of \fInumber\fP is expected to be relatively small. When
169 \fB-c\fP is used, \fB-B\fP is ignored.
172 Specify how binary files are to be processed. If the word is "binary" (the
173 default), pattern matching is performed on binary files, but the only output is
174 "Binary file <name> matches" when a match succeeds. If the word is "text",
175 which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are
178 sent to a terminal. If the word is "without-match", which is equivalent to the
184 Set the parameter that controls how much memory is obtained at the start of
190 This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.
195 \fB-v\fP is set, because they failed to match. By default, this count is
197 \fB-M\fP (multiline) option is used (without \fB-v\fP), there may be more
198 suppressed lines than the count (that is, the number of matches).
200 If no lines are selected, the number zero is output. If several files are are
201 being scanned, a count is output for each of them and the \fB-t\fP option can
203 \fB--files-with-matches\fP option is also used, only those files whose counts
204 are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP,
208 If this option is given without any data, it is equivalent to "--colour=auto".
209 If data is required, it must be given in the same shell item, separated by an
214 a pattern should be coloured in the output. By default, the output is not
215 coloured. The value (which is optional, see above) may be "never", "always", or
216 "auto". In the latter case, colouring happens only if the standard output is
217 connected to a terminal. More resources are used when colouring is enabled,
221 The colour that is used can be specified by setting one of the environment
228 string or by a colon. If GREP_COLORS does not start with "ms=" or "mt=" it is
229 ignored, and GREP_COLOR is checked.
232 other than semicolon or digits, the setting is ignored and the default colour
233 is used. The string is copied directly into the control string for setting
234 colour on a terminal, so it is your responsibility to ensure that the values
235 make sense. If no relevant environment variable is set, the default is "1;31",
239 If an input path is not a regular file or a directory, "action" specifies how
240 it is to be processed. Valid values are "read" (the default) or "skip"
244 If an input path is a directory, "action" specifies how it is to be processed.
249 operating systems the effect of reading a directory like this is an immediate
258 single pattern that starts with a hyphen. When \fB-e\fP is used, no argument
259 pattern is taken from the command line; all arguments are treated as file
260 names. There is no limit to the number of patterns. They are applied to each
263 If \fB-f\fP is used with \fB-e\fP, the command line patterns are matched first,
265 these options are specified. Note that multiple use of \fB-e\fP is not the same
267 character in a line that is X or Y, whereas if the two patterns are given
268 separately, with X first, \fBpcre2grep\fP finds X if it is present, even if it
269 follows Y in the line. It finds Y only if there is no X in the line. This
276 obtained from \fB--file-list\fP, or by scanning a directory. The pattern is a
277 PCRE2 regular expression, and is matched against the final component of the
281 and an \fB--exclude\fP pattern, it is excluded. There is no short form for this
286 option. What constitutes a newline when reading the file is the operating
295 \fB--file-list\fP, or by scanning a parent directory. The pattern is a PCRE2
296 regular expression, and is matched against the final component of the directory
300 and \fB--exclude-dir\fP, it is excluded. There is no short form for this
306 this purpose is controlled by the \fB--newline\fP option. The \fB-w\fP (match
308 They apply to each of the fixed strings. A line is selected if any of the fixed
316 input. As is the case with patterns on the command line, no delimiters should
317 be used. What constitutes a newline when reading the file is the operating
319 effect on this option. Trailing white space is removed from each line, and
326 If this option is given more than once, all the specified files are read. A
327 data line is output if any of the patterns match it. A file name can be given
328 as "-" to refer to the standard input. When \fB-f\fP is used, patterns
330 tested before the file's patterns. However, no other pattern is taken from the
335 file, one per line. What constitutes a newline when reading the file is the
336 operating system's default. Trailing white space is removed from each line, and
340 patterns are read first. This is useful only when the standard input is a
342 end-of-file indication. If this option is given more than once, all the
348 mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP
349 options are ignored. If there is more than one match in a line, each of them is
350 shown separately. This option is mutually exclusive with \fB--output\fP,
355 searching a single file. By default, the file name is not shown in this case.
356 For matching lines, the file name is followed by a colon; for context lines, a
357 hyphen separator is used. If a line number is also being output, it follows the
359 line, only the first is preceded by the file name. This option overrides any
365 file name is followed by a colon; for context lines, a hyphen separator is used.
366 If a line number is also being output, it follows the file name. This option
374 type support, and then exit. Anything else on the command line is
378 Ignore binary files. This is equivalent to
389 \fB--file-list\fP, or by scanning a directory. The pattern is a PCRE2 regular
390 expression, and is matched against the final component of the file name, not
393 matches both an \fB--include\fP and an \fB--exclude\fP pattern, it is excluded.
394 There is no short form for this option.
398 option. What constitutes a newline for this purpose is the operating system's
407 directory. The pattern is a PCRE2 regular expression, and is matched against
411 \fB--exclude-dir\fP, it is excluded. There is no short form for this option.
415 that do not contain any lines that would have been output. Each file name is
421 containing lines that would have been output. Each file name is output once, on
422 a separate line. Searching normally stops as soon as a matching line is found
423 in a file. However, if the \fB-c\fP (count) option is also used, matching
426 \fB-c\fP is a way of suppressing the listing of files with no matches. This
431 are being output. If not supplied, "(standard input)" is used. There is no
435 When this option is given, non-compressed input is read and processed line by
436 line, and the output is flushed after each write. By default, input is read in
437 large chunks, unless \fBpcre2grep\fP can determine that it is reading from a
438 terminal (which is currently possible only in Unix-like environments or
439 Windows). Output to terminal is normally automatically flushed by the operating
440 system. This option can be useful when the input or output is attached to a
443 ceases to work. When input is from a compressed .gz or .bz2 file,
444 \fB--line-buffered\fP is ignored.
449 number is terminated by a colon (as usual; see the \fB-n\fP option), and the
450 offset and length are separated by a comma. In this mode, no context is shown.
451 That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. If there is
452 more than one match in a line, each of them is shown separately. This option is
459 locale is specified, the PCRE2 library's default (usually the "C" locale) is
460 used. There is no short form for this option.
471 counter that is incremented each time around its main processing loop. If the
472 value set by \fB--match-limit\fP is reached, an error occurs.
476 memory is needed only if matching the pattern requires a significant number of
481 which indirectly limits the amount of memory that is used. The amount of memory
483 parentheses in the pattern, so the amount of memory that is used before this
484 limit acts varies from pattern to pattern. This limit is of use only if it is
488 when the PCRE2 library is compiled; if they are not specified, the defaults
493 set by \fB--buffer-size\fP. The maximum buffer size is silently forced to be no
497 Allow patterns to match more than one line. When this option is set, the PCRE2
498 library is called in "multiline" mode. This allows a matched string to extend
502 consist of more than one line. The first line is the line in which the match
503 started, and the last line is the line in which the match ended. If the matched
505 If \fB-v\fP is set, none of the lines in a multi-line match are output. Once a
517 and is followed by + so as to match trailing white space on the first line as
520 There is a limit to the number of lines that can be matched, imposed by the way
523 does not work when input is read line by line (see \fP--line-buffered\fP.)
530 which any Unicode line ending sequence is assumed to end a line. The Unicode
535 When the PCRE2 library is built, a default line-ending sequence is specified.
536 This is normally the standard sequence for the operating system. Unless
541 that is being scanned does not agree with the convention set by this option,
549 for matching lines or a hyphen for context lines. If the file name is also
551 pattern to match more than one line, only the first is preceded by its line
552 number. This option is forced if \fB--line-offsets\fP is used.
555 If the PCRE2 library is built with support for just-in-time compiling (which
558 use of JIT at run time. It is provided for testing and working round problems.
562 When there is a match, instead of outputting the whole line that matched,
563 output just the given text. This option is mutually exclusive with
568 $<digits> or ${<digits>} is replaced by the captured
570 the number is greater than the number of capturing substrings, or if the
571 capture is unset, the replacement is empty.
573 $a is replaced by bell; $b by backspace; $e by escape; $f by form feed; $n by
576 $o<digits> is replaced by the character represented by the given octal
579 $x<digits> is replaced by the character represented by the given hexadecimal
582 Any other character is substituted by itself. In particular, $$ is replaced by
587 line. In this mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and
588 \fB-C\fP options are ignored. If there is more than one match in a line, each
589 of them is shown separately, on a separate line of output. If \fB-o\fP is
591 lines), no output is generated, but the return code is set appropriately. If
592 the matched portion of the line is empty, nothing is output unless the file
594 otherwise empty line. This option is mutually exclusive with \fB--output\fP,
599 given number. Up to 32 capturing parentheses are supported, and -o0 is
601 without an argument (see above), if an argument is present, it must be given in
605 match, nothing is output unless the file name or line number are being output.
607 If this option is given multiple times, multiple substrings are output for each
610 then 3 again to be output. By default, there is no separator (but see the next
618 Work quietly, that is, display nothing except error messages. The exit
622 If any given path is a directory, recursively scan the files it contains,
624 directory is read as a normal file; in some operating systems this gives an
625 immediate end-of-file. This option is a shorthand for setting the \fB-d\fP
633 quietly skipped. However, the return code is still 2, even if matches were
637 This option is useful when scanning more than one file. If used on its own,
639 lines (or non-matching lines if \fB-v\fP is used) in all the files. If \fB-t\fP
640 is used with \fB-c\fP, a grand total is output except when the previous output
641 is just one line. In other words, it is not output when just one file's count
642 is listed. If file names are being output, the grand total is preceded by
643 "TOTAL:". Otherwise, it appears as just another number. The \fB-t\fP option is
648 Operate in UTF-8 mode. This option is available only if PCRE2 has been compiled
655 standard output and then exit. Anything else on the command line is
663 Force the patterns only to match "words". That is, there must be a word
664 boundary at the start and end of each matched string. This is equivalent to
673 be more than one line. This is equivalent to having "^(?:" at the start of each
683 order, for a locale. The first one that is set is used. This can be overridden
684 by the \fB--locale\fP option. If no locale is set, the PCRE2 library's default
685 (usually the "C" locale) is used.
709 \fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
715 \fBpcre2grep\fP, as is the use of the \fB--only-matching\fP option with a
719 \fBpcre2grep\fP. For example, the \fB--include\fP option's argument is a glob
729 If a short form option is used, the data may follow immediately, or (with one
735 The exception is the \fB-o\fP option, which may appear with or without data.
736 Because of this, if data is present, it must follow immediately in the same
739 If a long form option is used, the data may appear in the same command line
749 specially unless it is at the start of an item.
752 \fB--only-matching\fP options, for which the data is optional. If one of these
762 callout facility. However, this support can be disabled when \fBpcre2grep\fP is
764 it with the \fB--help\fP option. If the support is not enabled, all callouts in
767 A callout in a PCRE2 pattern is of the form (?C<arg>) where the argument is
787 started by a dollar character: $<digits> or ${<digits>} is replaced by the
789 zero. If the number is greater than the number of capturing substrings, or if
790 the capture is unset, the replacement is empty.
792 Any other character is substituted by itself. In particular, $$ is replaced by
793 a single dollar and $| is replaced by a pipe character. Here is an example:
806 The parameters for the \fBexecv()\fP system call that is used to run the
820 the string is written to the output, having been passed through the same escape
822 facility that avoids calling an external program or script. No terminator is
824 Matching continues normally after the string is output. If you want to see only
832 It is possible to supply a regular expression that takes a very long time to
849 Exit status is 0 if any matches were found, 1 if no matches were found, and 2
855 When run under VMS, the return code is placed in the symbol PCRE2GREP_RC