• 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
56 The default value for this parameter is specified when \fBpcre2grep\fP is
58 size is used (to allow for buffering "before" and "after" lines). An error
61 Patterns can be no longer than 8K or BUFSIZ bytes, whichever is the greater.
62 BUFSIZ is defined in \fB<stdio.h>\fP. When there is more than one pattern
63 (specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to
68 considered. However, if \fB--colour\fP (or \fB--color\fP) is used to colour the
70 \fB--line-offsets\fP is used to output only the part of the line that matched
78 can affect the output when one of the above options is used. This is no longer
80 for later patterns (as long as there is no overlap).
83 matches are never recognized. An example is the pattern "(super)?(man)?", in
88 If the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variable is set,
96 It is possible to compile \fBpcre2grep\fP so that it uses \fBlibz\fP or
100 appropriate support is not present, files are treated as plain text. The
101 standard input is always so treated.
108 is identified as a binary file, and is processed specially. (GNU grep also
119 effect. Similarly, except where noted below, if an option is given twice, the
120 later setting is used. Numerical values for options may be followed by K or M,
124 This terminates the list of options. It is useful if the next item on the
125 command line starts with a hyphen but is not an option. This allows for the
130 and/or line numbers are being output, a hyphen separator is used instead of a
131 colon for the context lines. A line containing "--" is output between each
133 of \fInumber\fP is expected to be relatively small. However, \fBpcre2grep\fP
137 Treat binary files as text. This is equivalent to
142 and/or line numbers are being output, a hyphen separator is used instead of a
143 colon for the context lines. A line containing "--" is output between each
145 of \fInumber\fP is expected to be relatively small. However, \fBpcre2grep\fP
149 Specify how binary files are to be processed. If the word is "binary" (the
150 default), pattern matching is performed on binary files, but the only output is
151 "Binary file <name> matches" when a match succeeds. If the word is "text",
152 which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are
155 sent to a terminal. If the word is "without-match", which is equivalent to the
161 Set the parameter that controls how much memory is used for buffering files
166 This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.
170 number of matches (or non-matches if \fB-v\fP is used) that would otherwise
171 have caused lines to be shown. By default, this count is the same as the number
172 of suppressed lines, but if the \fB-M\fP (multiline) option is used (without
175 If no lines are selected, the number zero is output. If several files are are
176 being scanned, a count is output for each of them. However, if the
177 \fB--files-with-matches\fP option is also used, only those files whose counts
178 are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP,
182 If this option is given without any data, it is equivalent to "--colour=auto".
183 If data is required, it must be given in the same shell item, separated by an
188 a pattern should be coloured in the output. By default, the output is not
189 coloured. The value (which is optional, see above) may be "never", "always", or
190 "auto". In the latter case, colouring happens only if the standard output is
191 connected to a terminal. More resources are used when colouring is enabled,
195 The colour that is used can be specified by setting the environment variable
198 the control string for setting colour on a terminal, so it is your
200 variables is set, the default is "1;31", which gives red.
203 If an input path is not a regular file or a directory, "action" specifies how
204 it is to be processed. Valid values are "read" (the default) or "skip"
208 If an input path is a directory, "action" specifies how it is to be processed.
213 operating systems the effect of reading a directory like this is an immediate
219 single pattern that starts with a hyphen. When \fB-e\fP is used, no argument
220 pattern is taken from the command line; all arguments are treated as file
221 names. There is no limit to the number of patterns. They are applied to each
224 If \fB-f\fP is used with \fB-e\fP, the command line patterns are matched first,
226 these options are specified. Note that multiple use of \fB-e\fP is not the same
228 character in a line that is X or Y, whereas if the two patterns are given
229 separately, with X first, \fBpcre2grep\fP finds X if it is present, even if it
230 follows Y in the line. It finds Y only if there is no X in the line. This
237 obtained from \fB--file-list\fP, or by scanning a directory. The pattern is a
238 PCRE2 regular expression, and is matched against the final component of the
242 and an \fB--exclude\fP pattern, it is excluded. There is no short form for this
247 option. What constitutes a newline when reading the file is the operating
256 \fB--file-list\fP, or by scanning a parent directory. The pattern is a PCRE2
257 regular expression, and is matched against the final component of the directory
261 and \fB--exclude-dir\fP, it is excluded. There is no short form for this
267 this purpose is controlled by the \fB--newline\fP option. The \fB-w\fP (match
269 They apply to each of the fixed strings. A line is selected if any of the fixed
277 each line of input. What constitutes a newline when reading the file is the
279 option. Trailing white space is removed from each line, and blank lines are
284 If this option is given more than once, all the specified files are
285 read. A data line is output if any of the patterns match it. A file name can
286 be given as "-" to refer to the standard input. When \fB-f\fP is used, patterns
288 tested before the file's patterns. However, no other pattern is taken from the
293 file, one per line. Trailing white space is removed from each line, and blank
297 read first. This is useful only when the standard input is a terminal, from
299 indication. If this option is given more than once, all the specified files are
305 mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP
306 options are ignored. If there is more than one match in a line, each of them is
307 shown separately. This option is mutually exclusive with \fB--line-offsets\fP
312 searching a single file. By default, the file name is not shown in this case.
313 For matching lines, the file name is followed by a colon; for context lines, a
314 hyphen separator is used. If a line number is also being output, it follows the
316 line, only the first is preceded by the file name.
321 file name is followed by a colon; for context lines, a hyphen separator is used.
322 If a line number is also being output, it follows the file name.
326 type support, and then exit. Anything else on the command line is
330 Ignore binary files. This is equivalent to
341 \fB--file-list\fP, or by scanning a directory. The pattern is a PCRE2 regular
342 expression, and is matched against the final component of the file name, not
345 matches both an \fB--include\fP and an \fB--exclude\fP pattern, it is excluded.
346 There is no short form for this option.
350 option. What constitutes a newline for this purpose is the operating system's
359 directory. The pattern is a PCRE2 regular expression, and is matched against
363 \fB--exclude-dir\fP, it is excluded. There is no short form for this option.
367 that do not contain any lines that would have been output. Each file name is
372 containing lines that would have been output. Each file name is output
374 is found in a file. However, if the \fB-c\fP (count) option is also used,
377 with \fB-c\fP is a way of suppressing the listing of files with no matches.
381 are being output. If not supplied, "(standard input)" is used. There is no
385 When this option is given, input is read and processed line by line, and the
386 output is flushed after each write. By default, input is read in large chunks,
387 unless \fBpcre2grep\fP can determine that it is reading from a terminal (which
388 is currently possible only in Unix-like environments). Output to terminal is
390 useful when the input or output is attached to a pipe and you do not want
397 number is terminated by a colon (as usual; see the \fB-n\fP option), and the
398 offset and length are separated by a comma. In this mode, no context is shown.
399 That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. If there is
400 more than one match in a line, each of them is shown separately. This option is
406 locale is specified, the PCRE2 library's default (usually the "C" locale) is
407 used. There is no short form for this option.
411 memory, leading in some cases to a program crash if not enough is available.
413 strings. The \fBpcre2_match()\fP function that is called by \fBpcre2grep\fP to
418 large number of possibilities in their search trees. The classic example is a
421 limit set by \fB--match-limit\fP is imposed on the number of times this
422 function is called during a match, which has the effect of limiting the amount
425 The \fB--recursion-limit\fP option is similar to \fB--match-limit\fP, but
426 instead of limiting the total number of times that \fBmatch()\fP is called, it
428 that can be used. The recursion depth is a smaller number than the total number
429 of calls, because not all calls to \fBmatch()\fP are recursive. This limit is
430 of use only if it is set smaller than \fB--match-limit\fP.
433 when the PCRE2 library is compiled, with the default default being 10 million.
436 Allow patterns to match more than one line. When this option is given, patterns
439 one line. The first is the line in which the match started, and the last is the
443 When this option is set, the PCRE2 library is called in "multiline" mode. This
447 the next line, just as it does when \fB-M\fP is not present. This means that it
459 and is followed by + so as to match trailing white space on the first line as
462 There is a limit to the number of lines that can be matched, imposed by the way
465 (whichever is the shorter) are available for forward matching, and similarly
468 does not work when input is read line by line (see \fP--line-buffered\fP.)
475 which any Unicode line ending sequence is assumed to end a line. The Unicode
480 When the PCRE2 library is built, a default line-ending sequence is specified.
481 This is normally the standard sequence for the operating system. Unless
486 that is being scanned does not agree with the convention set by this option,
494 for matching lines or a hyphen for context lines. If the file name is also
496 pattern to match more than one line, only the first is preceded by its line
497 number. This option is forced if \fB--line-offsets\fP is used.
500 If the PCRE2 library is built with support for just-in-time compiling (which
503 use of JIT at run time. It is provided for testing and working round problems.
508 line. In this mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and
509 \fB-C\fP options are ignored. If there is more than one match in a line, each
510 of them is shown separately. If \fB-o\fP is combined with \fB-v\fP (invert the
511 sense of the match to find non-matching lines), no output is generated, but the
512 return code is set appropriately. If the matched portion of the line is empty,
513 nothing is output unless the file name or line number are being printed, in
514 which case they are shown on an otherwise empty line. This option is mutually
519 given number. Up to 32 capturing parentheses are supported, and -o0 is
521 without an argument (see above), if an argument is present, it must be given in
525 match, nothing is output unless the file name or line number are being output.
527 If this option is given multiple times, multiple substrings are output, in the
530 default, there is no separator (but see the next option).
537 Work quietly, that is, display nothing except error messages. The exit
541 If any given path is a directory, recursively scan the files it contains,
543 directory is read as a normal file; in some operating systems this gives an
544 immediate end-of-file. This option is a shorthand for setting the \fB-d\fP
552 quietly skipped. However, the return code is still 2, even if matches were
556 Operate in UTF-8 mode. This option is available only if PCRE2 has been compiled
563 standard output and then exit. Anything else on the command line is
571 Force the patterns to match only whole words. This is equivalent to having \eb
578 a line) and in addition, require them to match entire lines. This is equivalent
589 order, for a locale. The first one that is set is used. This can be overridden
590 by the \fB--locale\fP option. If no locale is set, the PCRE2 library's default
591 (usually the "C" locale) is used.
614 \fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
619 \fBpcre2grep\fP, as is the use of the \fB--only-matching\fP option with a
623 \fBpcre2grep\fP. For example, the \fB--include\fP option's argument is a glob
633 If a short form option is used, the data may follow immediately, or (with one
639 The exception is the \fB-o\fP option, which may appear with or without data.
640 Because of this, if data is present, it must follow immediately in the same
643 If a long form option is used, the data may appear in the same command line
653 specially unless it is at the start of an item.
656 \fB--only-matching\fP options, for which the data is optional. If one of these
666 facility. However, this support can be disabled when \fBpcre2grep\fP is built.
668 with the \fB--help\fP option. If the support is not enabled, all callouts in
671 A callout in a PCRE2 pattern is of the form (?C<arg>) where the argument is
684 started by a dollar character: $<digits> or ${<digits>} is replaced by the
686 zero. If the number is greater than the number of capturing substrings, or if
687 the capture is unset, the replacement is empty.
689 Any other character is substituted by itself. In particular, $$ is replaced by
690 a single dollar and $| is replaced by a pipe character. Here is an example:
703 The parameters for the \fBexecv()\fP system call that is used to run the
716 It is possible to supply a regular expression that takes a very long time to
725 overall resource limit; there is a second option called \fB--recursion-limit\fP
726 that sets a limit on the amount of memory (usually stack) that is used (see the
733 Exit status is 0 if any matches were found, 1 if no matches were found, and 2