Lines Matching +full:file +full:- +full:lines
3 pcre2grep - a grep with Perl-compatible regular expressions.
16 for a quick-reference summary of pattern syntax, or
23 Patterns, whether supplied on the command line or in a separate file, are given
35 pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present.
37 arguments are treated as path names. At least one of \fB-e\fP, \fB-f\fP, or an
44 pcre2grep some-pattern file1 - file3
49 to the standard output, and if there is more than one file, the file name is
51 options that can change how \fBpcre2grep\fP behaves. For example, the \fB-M\fP
53 defines a line boundary is controlled by the \fB-N\fP (\fB--newline\fP) option.
54 The \fB-h\fP and \fB-H\fP options control whether or not file names are shown,
55 and the \fB-Z\fP option changes the file name terminator to a zero byte.
58 controlled by parameters that can be set by the \fB--buffer-size\fP and
59 \fB--max-buffer-size\fP options. The first of these sets the size of buffer
60 that is obtained at the start of processing. If an input file contains very
61 long lines, a larger buffer may be needed; this is handled by automatically
62 extending the buffer, up to the limit specified by \fB--max-buffer-size\fP. The
69 allow for buffering "before" and "after" lines. If the buffer size is too
70 small, fewer than requested "before" and "after" lines may be output.
77 (specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to
78 each line in the order in which they are defined, except that all the \fB-e\fP
79 patterns are tried before the \fB-f\fP patterns.
82 considered. However, if \fB--colour\fP (or \fB--color\fP) is used to colour the
83 matching substrings, or if \fB--only-matching\fP, \fB--file-offsets\fP,
84 \fB--line-offsets\fP, or \fB--output\fP is used to output only the part of the
108 The \fB--locale\fP option can be used to override this.
114 Compile-time options for \fBpcre2grep\fP can set it up to use \fBlibz\fP or
117 has support for one or both of these file types by running it with the
118 \fB--help\fP option. If the appropriate support is not present, all files are
119 treated as plain text. The standard input is always so treated. If a file with
121 plain text file. When input is from a compressed .gz or .bz2 file, the
122 \fB--line-buffered\fP option is ignored.
128 By default, a file that contains a binary zero byte within the first 1024 bytes
129 is identified as a binary file, and is processed specially. However, if the
131 zero, the test for a binary file is not applied. See the \fB--binary-files\fP
140 from a file via the \fB-f\fP option may contain binary zeros.
147 example, both the \fB-H\fP and \fB-l\fP options affect the printing of file
153 \fB--\fP
156 processing of patterns and file names that start with hyphens.
158 \fB-A\fP \fInumber\fP, \fB--after-context=\fP\fInumber\fP
159 Output up to \fInumber\fP lines of context after each matching line. Fewer
160 lines are output if the next match or the end of the file is reached, or if the
161 processing buffer size has been set too small. If file names and/or line
163 context lines (the \fB-Z\fP option can be used to change the file name
164 terminator to a zero byte). A line containing "--" is output between each group
165 of lines, unless they are in fact contiguous in the input file. The value of
166 \fInumber\fP is expected to be relatively small. When \fB-c\fP is used,
167 \fB-A\fP is ignored.
169 \fB-a\fP, \fB--text\fP
171 \fB--binary-files\fP=\fItext\fP.
173 \fB--allow-lookaround-bsk\fP
178 \fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP
179 Output up to \fInumber\fP lines of context before each matching line. Fewer
180 lines are output if the previous match or the start of the file is within
181 \fInumber\fP lines, or if the processing buffer size has been set too small. If
182 file names and/or line numbers are being output, a hyphen separator is used
183 instead of a colon for the context lines (the \fB-Z\fP option can be used to
184 change the file name terminator to a zero byte). A line containing "--" is
185 output between each group of lines, unless they are in fact contiguous in the
186 input file. The value of \fInumber\fP is expected to be relatively small. When
187 \fB-c\fP is used, \fB-B\fP is ignored.
189 \fB--binary-files=\fP\fIword\fP
192 "Binary file <name> matches" when a match succeeds. If the word is "text",
193 which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are
194 processed in the same way as any other file. In this case, when a match
196 sent to a terminal. If the word is "without-match", which is equivalent to the
197 \fB-I\fP option, binary files are not processed at all; they are assumed not to
201 \fB--buffer-size=\fP\fInumber\fP
204 \fB--max-buffer-size\fP below.
206 \fB-C\fP \fInumber\fP, \fB--context=\fP\fInumber\fP
207 Output \fInumber\fP lines of context both before and after each matching line.
208 This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.
210 \fB-c\fP, \fB--count\fP
211 Do not output lines from the files that are being scanned; instead output the
212 number of lines that would have been shown, either because they matched, or, if
213 \fB-v\fP is set, because they failed to match. By default, this count is
214 exactly the same as the number of lines that would have been output, but if the
215 \fB-M\fP (multiline) option is used (without \fB-v\fP), there may be more
216 suppressed lines than the count (that is, the number of matches).
218 If no lines are selected, the number zero is output. If several files are
219 being scanned, a count is output for each of them and the \fB-t\fP option can
221 \fB--files-with-matches\fP option is also used, only those files whose counts
222 are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP,
223 \fB-B\fP, and \fB-C\fP options are ignored.
225 \fB--colour\fP, \fB--color\fP
226 If this option is given without any data, it is equivalent to "--colour=auto".
230 \fB--colour=\fP\fIvalue\fP, \fB--color=\fP\fIvalue\fP
233 \fB--file-offsets\fP, \fB--line-offsets\fP, or \fB--output\fP is set. By
234 default, output is not coloured. The value for the \fB--colour\fP option (which
247 followed by two semicolon-separated colours, terminated by the end of the
258 \fB-D\fP \fIaction\fP, \fB--devices=\fP\fIaction\fP
259 If an input path is not a regular file or a directory, "action" specifies how
263 \fB-d\fP \fIaction\fP, \fB--directories=\fP\fIaction\fP
265 Valid values are "read" (the default in non-Windows environments, for
266 compatibility with GNU grep), "recurse" (equivalent to the \fB-r\fP option), or
270 end-of-file; in others it may provoke an error.
272 \fB--depth-limit\fP=\fInumber\fP
273 See \fB--match-limit\fP below.
275 \fB-E\fP, \fB--case-restrict\fP
280 character matches a non-ASCII character, and vice versa.
282 \fB-e\fP \fIpattern\fP, \fB--regex=\fP\fIpattern\fP, \fB--regexp=\fP\fIpattern\fP
285 single pattern that starts with a hyphen. When \fB-e\fP is used, no argument
286 pattern is taken from the command line; all arguments are treated as file
290 If \fB-f\fP is used with \fB-e\fP, the command line patterns are matched first,
291 followed by the patterns from the file(s), independent of the order in which
294 \fB--exclude\fP=\fIpattern\fP
297 obtained from \fB--file-list\fP, or by scanning a directory. The pattern is a
299 file name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do
301 to specify multiple patterns. If a file name matches both an \fB--include\fP
302 and an \fB--exclude\fP pattern, it is excluded. There is no short form for this
305 \fB--exclude-from=\fP\fIfilename\fP
306 Treat each non-empty line of the file as the data for an \fB--exclude\fP
307 option. What constitutes a newline when reading the file is the operating
308 system's default. The \fB--newline\fP option has no effect on this option. This
312 \fB--exclude-dir\fP=\fIpattern\fP
314 whatever the setting of the \fB--recursive\fP option. This applies to all
316 \fB--file-list\fP, or by scanning a parent directory. The pattern is a PCRE2
318 name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not
320 specify more than one pattern. If a directory matches both \fB--include-dir\fP
321 and \fB--exclude-dir\fP, it is excluded. There is no short form for this
324 \fB-F\fP, \fB--fixed-strings\fP
325 Interpret each data-matching pattern as a list of fixed strings, separated by
327 this purpose is controlled by the \fB--newline\fP option. The \fB-w\fP (match
328 as a word) and \fB-x\fP (match whole line) options can be used with \fB-F\fP.
330 strings are found in it (subject to \fB-w\fP or \fB-x\fP, if present). This
332 files; it does not apply to patterns specified by any of the \fB--include\fP or
333 \fB--exclude\fP options.
335 \fB-f\fP \fIfilename\fP, \fB--file=\fP\fIfilename\fP
336 Read patterns from the file, one per line. As is the case with patterns on the
338 reading the file is the operating system's default interpretation of \en. The
339 \fB--newline\fP option has no effect on this option. Trailing white space is
340 removed from each line, and blank lines are ignored. An empty file contains no
341 patterns and therefore matches nothing. Patterns read from a file in this way
345 data line is output if any of the patterns match it. A file name can be given
346 as "-" to refer to the standard input. When \fB-f\fP is used, patterns
347 specified on the command line using \fB-e\fP may also be present; they are
348 matched before the file's patterns. However, no pattern is taken from the
351 \fB--file-list\fP=\fIfilename\fP
353 file, one per line. What constitutes a newline when reading the file is the
355 blank lines are ignored. These paths are processed before any that are listed
356 on the command line. The file name can be given as "-" to refer to the standard
357 input. If \fB--file\fP and \fB--file-list\fP are both specified as "-",
359 terminal, from which further lines (the list of files) can be read after an
360 end-of-file indication. If this option is given more than once, all the
363 \fB--file-offsets\fP
364 Instead of showing lines or parts of lines that match, show each match as an
365 offset from the start of the file and a length, separated by a comma. In this
366 mode, \fB--colour\fP has no effect, and no context is shown. That is, the
367 \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. If there is more than one
369 exclusive with \fB--output\fP, \fB--line-offsets\fP, and \fB--only-matching\fP.
371 \fB--group-separator\fP=\fItext\fP
372 Output this text string instead of two hyphens between groups of lines when
373 \fB-A\fP, \fB-B\fP, or \fB-C\fP is in use. See also \fB--no-group-separator\fP.
375 \fB-H\fP, \fB--with-filename\fP
376 Force the inclusion of the file name at the start of output lines when
377 searching a single file. The file name is not normally shown in this case.
378 By default, for matching lines, the file name is followed by a colon; for
379 context lines, a hyphen separator is used. The \fB-Z\fP option can be used to
381 it follows the file name. When the \fB-M\fP option causes a pattern to match
382 more than one line, only the first is preceded by the file name. This option
383 overrides any previous \fB-h\fP, \fB-l\fP, or \fB-L\fP options.
385 \fB-h\fP, \fB--no-filename\fP
386 Suppress the output file names when searching multiple files. File names are
388 lines, the file name is followed by a colon; for context lines, a hyphen
389 separator is used. The \fB-Z\fP option can be used to change the terminator to
390 a zero byte. If a line number is also being output, it follows the file name.
391 This option overrides any previous \fB-H\fP, \fB-L\fP, or \fB-l\fP options.
393 \fB--heap-limit\fP=\fInumber\fP
394 See \fB--match-limit\fP below.
396 \fB--help\fP
397 Output a help message, giving brief details of the command options and file
401 \fB-I\fP
403 \fB--binary-files\fP=\fIwithout-match\fP.
405 \fB-i\fP, \fB--ignore-case\fP
407 matching path names for inclusion or exclusion as well as when matching lines
410 \fB--include\fP=\fIpattern\fP
411 If any \fB--include\fP patterns are specified, the only files that are
413 \fB--exclude\fP pattern. This option does not affect directories, but it
415 \fB--file-list\fP, or by scanning a directory. The pattern is a PCRE2 regular
416 expression, and is matched against the final component of the file name, not
417 the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not apply to
418 this pattern. The option may be given any number of times. If a file name
419 matches both an \fB--include\fP and an \fB--exclude\fP pattern, it is excluded.
422 \fB--include-from=\fP\fIfilename\fP
423 Treat each non-empty line of the file as the data for an \fB--include\fP
425 default. The \fB--newline\fP option has no effect on this option. This option
428 \fB--include-dir\fP=\fIpattern\fP
429 If any \fB--include-dir\fP patterns are specified, the only directories that
431 an \fB--exclude-dir\fP pattern. This applies to all directories, whether listed
432 on the command line, obtained from \fB--file-list\fP, or by scanning a parent
434 the final component of the directory name, not the entire path. The \fB-F\fP,
435 \fB-w\fP, and \fB-x\fP options do not apply to this pattern. The option may be
436 given any number of times. If a directory matches both \fB--include-dir\fP and
437 \fB--exclude-dir\fP, it is excluded. There is no short form for this option.
439 \fB-L\fP, \fB--files-without-match\fP
440 Instead of outputting lines from the files, just output the names of the files
441 that do not contain any lines that would have been output. Each file name is
442 output once, on a separate line by default, but if the \fB-Z\fP option is set,
444 previous \fB-H\fP, \fB-h\fP, or \fB-l\fP options.
446 \fB-l\fP, \fB--files-with-matches\fP
447 Instead of outputting lines from the files, just output the names of the files
448 containing lines that would have been output. Each file name is output once, on
449 a separate line, but if the \fB-Z\fP option is set, they are separated by zero
451 is found in a file. However, if the \fB-c\fP (count) option is also used,
454 with \fB-c\fP is a way of suppressing the listing of files with no matches that
455 occurs with \fB-c\fP on its own. This option overrides any previous \fB-H\fP,
456 \fB-h\fP, or \fB-L\fP options.
458 \fB--label\fP=\fIname\fP
459 This option supplies a name to be used for the standard input when file names
463 \fB--line-buffered\fP
464 When this option is given, non-compressed input is read and processed line by
467 terminal, which is currently possible only in Unix-like environments or
471 However, its use will affect performance, and the \fB-M\fP (multiline) option
472 ceases to work. When input is from a compressed .gz or .bz2 file,
473 \fB--line-buffered\fP is ignored.
475 \fB--line-offsets\fP
476 Instead of showing lines or parts of lines that match, show each match as a
478 number is terminated by a colon (as usual; see the \fB-n\fP option), and the
479 offset and length are separated by a comma. In this mode, \fB--colour\fP has no
480 effect, and no context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP
482 shown separately. This option is mutually exclusive with \fB--output\fP,
483 \fB--file-offsets\fP, and \fB--only-matching\fP.
485 \fB--locale\fP=\fIlocale-name\fP
491 \fB-M\fP, \fB--multiline\fP
494 the end of the initial line and onto one or more subsequent lines.
496 Patterns used with \fB-M\fP may usefully contain literal newline characters and
498 match at internal newlines. Because \fBpcre2grep\fP is scanning multiple lines,
499 the \eZ and \ez assertions match only at the end of the last line in the file.
501 be any line in the file; it is not anchored to the first line.
506 output ends at the end of that line. If \fB-v\fP is set, none of the lines in a
507 multi-line match are output. Once a match has been handled, scanning restarts
510 The newline sequence that separates multiple lines must be matched as part of
511 the pattern. For example, to find the phrase "regular expression" in a file
515 pcre2grep -M 'regular\es+expression' <file>
519 well as possibly handling a two-character newline sequence.
521 There is a limit to the number of lines that can be matched, imposed by the way
522 that \fBpcre2grep\fP buffers the input file as it scans it. With a sufficiently
525 The \fB-M\fP option does not work when input is read line by line (see
526 \fB--line-buffered\fP.)
528 \fB-m\fP \fInumber\fP, \fB--max-count\fP=\fInumber\fP
529 Stop processing after finding \fInumber\fP matching lines, or non-matching
530 lines if \fB-v\fP is also set. Any trailing context lines are output after the
533 a regular file, the file is left positioned just after the last matching line.
534 If \fB-c\fP is also set, the count that is output is never greater than
535 \fInumber\fP. This option has no effect if used with \fB-L\fP, \fB-l\fP, or
536 \fB-q\fP, or when just checking for a match in a binary file.
538 \fB--match-limit\fP=\fInumber\fP
543 The \fB--match-limit\fP option provides a means of limiting computing resource
548 value set by \fB--match-limit\fP is reached, an error occurs.
550 The \fB--heap-limit\fP option specifies, as a number of kibibytes (units of
553 The \fB--depth-limit\fP option limits the depth of nested backtracking points,
558 set smaller than \fB--match-limit\fP.
564 \fB--max-buffer-size\fP=\fInumber\fP
566 set by \fB--buffer-size\fP. The maximum buffer size is silently forced to be no
569 \fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP
570 Six different conventions for indicating the ends of lines in scanned files are
573 pcre2grep -N CRLF 'some pattern' <file>
576 newline type is NUL, lines are separated by binary zero characters. The other
577 types are the single-character sequences CR (carriage return) and LF
578 (linefeed), the two-character sequence CRLF, an "anycrlf" type, which
585 When the PCRE2 library is built, a default line-ending sequence is specified.
593 not apply to files specified by the \fB-f\fP, \fB--exclude-from\fP, or
594 \fB--include-from\fP options, which are expected to use the operating system's
597 \fB-n\fP, \fB--line-number\fP
598 Precede each output line by its line number in the file, followed by a colon
599 for matching lines or a hyphen for context lines. If the file name is also
600 being output, it precedes the line number. When the \fB-M\fP option causes a
602 number. This option is forced if \fB--line-offsets\fP is used.
604 \fB--no-group-separator\fP
605 Do not output a separator between groups of lines when \fB-A\fP, \fB-B\fP, or
606 \fB-C\fP is in use. The default is to output a line containing two hyphens. See
607 also \fB--group-separator\fP.
609 \fB--no-jit\fP
610 If the PCRE2 library is built with support for just-in-time compiling (which
616 \fB-O\fP \fItext\fP, \fB--output\fP=\fItext\fP
618 the text specified in this option, followed by an operating-system standard
619 newline. In this mode, \fB--colour\fP has no effect, and no context is shown.
620 That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. The
621 \fB--newline\fP option has no effect on this option, which is mutually
622 exclusive with \fB--only-matching\fP, \fB--file-offsets\fP, and
623 \fB--line-offsets\fP. However, like \fB--only-matching\fP, if there is more
651 \fB-o\fP, \fB--only-matching\fP
653 line. In this mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and
654 \fB-C\fP options are ignored. If there is more than one match in a line, each
655 of them is shown separately, on a separate line of output. If \fB-o\fP is
656 combined with \fB-v\fP (invert the sense of the match to find non-matching
657 lines), no output is generated, but the return code is set appropriately. If
658 the matched portion of the line is empty, nothing is output unless the file
660 otherwise empty line. This option is mutually exclusive with \fB--output\fP,
661 \fB--file-offsets\fP and \fB--line-offsets\fP.
663 \fB-o\fP\fInumber\fP, \fB--only-matching\fP=\fInumber\fP
666 limit can be changed via the \fB--om-capture\fP option. A pattern may contain
668 limit can be accessed by \fB-o\fP. An error occurs if the number specified by
669 \fB-o\fP is greater than the limit.
671 -o0 is the same as \fB-o\fP without a number. Because these options can be
673 given in the same shell item, for example, -o3 or --only-matching=2. The
674 comments given for the non-argument case above also apply to this option. If
676 set in the match, nothing is output unless the file name or line number are
681 -o3 -o1 -o3 causes the substrings matched by capturing parentheses 3 and 1 and
685 \fB--om-capture\fP=\fInumber\fP
686 Set the number of capturing parentheses that can be accessed by \fB-o\fP. The
689 \fB--om-separator\fP=\fItext\fP
690 Specify a separating string for multiple occurrences of \fB-o\fP. The default
693 \fB-P\fP, \fB--no-ucp\fP
694 Starting from release 10.43, when UTF/Unicode mode is specified with \fB-u\fP
695 or \fB-U\fP, the PCRE2_UCP option is used by default. This means that the
697 [:digit:] matches any Unicode decimal digit. The \fB--no-ucp\fP option
699 as was the case in earlier releases. Note that there are now more fine-grained
704 \fB-q\fP, \fB--quiet\fP
708 \fB-r\fP, \fB--recursive\fP
710 taking note of any \fB--include\fP and \fB--exclude\fP settings. By default, a
711 directory is read as a normal file; in some operating systems this gives an
712 immediate end-of-file. This option is a shorthand for setting the \fB-d\fP
715 \fB--recursion-limit\fP=\fInumber\fP
716 This is an obsolete synonym for \fB--depth-limit\fP. See \fB--match-limit\fP
719 \fB-s\fP, \fB--no-messages\fP
720 Suppress error messages about non-existent or unreadable files. Such files are
724 \fB-t\fP, \fB--total-count\fP
725 This option is useful when scanning more than one file. If used on its own,
726 \fB-t\fP suppresses all output except for a grand total number of matching
727 lines (or non-matching lines if \fB-v\fP is used) in all the files. If \fB-t\fP
728 is used with \fB-c\fP, a grand total is output except when the previous output
729 is just one line. In other words, it is not output when just one file's count
730 is listed. If file names are being output, the grand total is preceded by
731 "TOTAL:". Otherwise, it appears as just another number. The \fB-t\fP option is
732 ignored when used with \fB-L\fP (list files without matches), because the grand
735 \fB-u\fP, \fB--utf\fP
737 compiled with UTF-8 support. All patterns (including those for any
738 \fB--exclude\fP and \fB--include\fP options) and all lines that are scanned
739 must be valid strings of UTF-8 characters. If an invalid UTF-8 string is
742 \fB-U\fP, \fB--utf-allow-invalid\fP
743 As \fB--utf\fP, but in addition subject lines may contain invalid UTF-8 code
745 themselves, however, must still be valid UTF-8 strings. This facility allows
746 valid UTF-8 strings to be sought within arbitrary byte sequences in executable
747 or other binary files. For more details about matching in non-valid UTF-8
754 \fB-V\fP, \fB--version\fP
759 \fB-v\fP, \fB--invert-match\fP
760 Invert the sense of the match, so that lines which do \fInot\fP match any of
762 as \fB--only-matching\fP and \fB--output\fP, which specify parts of a match
765 \fB-w\fP, \fB--word-regex\fP, \fB--word-regexp\fP
770 files; it does not apply to patterns specified by any of the \fB--include\fP or
771 \fB--exclude\fP options.
773 \fB-x\fP, \fB--line-regex\fP, \fB--line-regexp\fP
774 Force the patterns to start matching only at the beginnings of lines, and in
775 addition, require them to match entire lines. In multiline mode the match may
779 by any of the \fB--include\fP or \fB--exclude\fP options.
781 \fB-Z\fP, \fB--null\fP
783 character) instead of what would normally appear. This is useful when file
785 option does not apply to file names in error messages.
793 by the \fB--locale\fP option. If no locale is set, the PCRE2 library's default
800 The \fB-N\fP (\fB--newline\fP) option allows \fBpcre2grep\fP to scan files with
803 specified by the \fB-f\fP, \fB--file-list\fP, \fB--exclude-from\fP, or
804 \fB--include-from\fP options.
808 the final line of a file is output, and it does not end with a newline
816 ends of output lines that are copied from the input is not converted to
826 in the GNU \fBgrep\fP program. Any long option of the form \fB--xxx-regexp\fP
827 (GNU terminology) is also available as \fB--xxx-regex\fP (PCRE2 terminology).
828 However, the \fB--case-restrict\fP, \fB--depth-limit\fP, \fB-E\fP,
829 \fB--file-list\fP, \fB--file-offsets\fP, \fB--heap-limit\fP,
830 \fB--include-dir\fP, \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP,
831 \fB-M\fP, \fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--no-ucp\fP,
832 \fB--om-separator\fP, \fB--output\fP, \fB-P\fP, \fB-u\fP, \fB--utf\fP,
833 \fB-U\fP, and \fB--utf-allow-invalid\fP options are specific to
834 \fBpcre2grep\fP, as is the use of the \fB--only-matching\fP option with a
838 \fBpcre2grep\fP. For example, the \fB--include\fP option's argument is a glob
840 the \fB-i\fP option applies. If both the \fB-c\fP and \fB-l\fP options are
841 given, GNU grep lists only file names, without counts, but \fBpcre2grep\fP
852 -f/some/file
853 -f /some/file
855 The exception is the \fB-o\fP option, which may appear with or without data.
857 item, for example -o3.
863 --file=/some/file
864 --file /some/file
866 Note, however, that if you want to supply a file name beginning with ~ as data
868 separate the file name from the option, because the shell does not treat ~
871 The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and
872 \fB--only-matching\fP options, for which the data is optional. If one of these
884 for callouts by running it with the \fB--help\fP option. If callout support is
905 zero-terminated string, which means it should not contain any internal binary
907 escape processing as text from the \fB--output\fP (\fB-O\fP) option (see
915 pcre2grep '(.)(..(.))(?C"|[$1] [$2] [$3]$n")' <some file>
927 where \fBlib$spawn()\fP is used, and for any Unix-like environment where
938 started by a dollar character. These are the same as for the \fB--output\fP
939 (\fB-O\fP) option documented above, except that $0 cannot insert the matched
944 echo -e "abcde\en12345" | pcre2grep \e
946 (?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4)")()' -
956 are zero-terminated strings. This means that binary zero characters in the
960 If running the program fails for any reason (including the non-existence of the
969 fail to match certain lines. Such patterns normally involve nested indefinite
976 The \fB--match-limit\fP option of \fBpcre2grep\fP can be used to set the
978 memory used during matching; see the discussion of \fB--heap-limit\fP and
979 \fB--depth-limit\fP above.
986 for syntax errors, overlong lines, non-existent or inaccessible files (even if
988 \fB-s\fP option to suppress error messages about inaccessible files does not
1017 Copyright (c) 1997-2023 University of Cambridge.