3 pcregrep - a grep with Perl-compatible regular expressions.
5 .B pcregrep [-Vcfhilnrsvx] pattern [file] ...
9 \fBpcregrep\fR searches files for character patterns, in the same way as other
10 grep commands do, but it uses the PCRE regular expression library to support
11 patterns that are compatible with the regular expressions of Perl 5. See
12 \fBpcre(3)\fR for a full description of syntax and semantics.
14 If no files are specified, \fBpcregrep\fR reads the standard input. By default,
15 each line that matches the pattern is copied to the standard output, and if
16 there is more than one file, the file name is printed before each line of
17 output. However, there are options that can change how \fBpcregrep\fR behaves.
19 Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB<stdio.h>\fR.
20 The newline character is removed from the end of each line before it is matched
27 Write the version number of the PCRE library being used to the standard error
31 Do not print individual lines; instead just print a count of the number of
32 lines that would otherwise have been printed. If several files are given, a
33 count is printed for each of them.
36 Read patterns from the file, one per line, and match all patterns against each
37 line. There is a maximum of 100 patterns. Trailing white space is removed, and
38 blank lines are ignored. An empty file contains no patterns and therefore
42 Suppress printing of filenames when searching multiple files.
45 Ignore upper/lower case distinctions during comparisons.
48 Instead of printing lines from the files, just print the names of the files
49 containing lines that would have been printed. Each file name is printed
50 once, on a separate line.
53 Precede each line by its line number in the file.
56 If any file is a directory, recursively scan the files it contains. Without
57 \fB-r\fR a directory is scanned as a normal file.
60 Work silently, that is, display nothing except error messages.
61 The exit status indicates whether any matches were found.
64 Invert the sense of the match, so that lines which do \fInot\fR match the
65 pattern are now the ones that are found.
68 Force the pattern to be anchored (it must start matching at the beginning of
69 the line) and in addition, require it to match the entire line. This is
70 equivalent to having ^ and $ characters at the start and end of each
71 alternative branch in the regular expression.
75 \fBpcre(3)\fR, Perl 5 documentation
79 Exit status is 0 if any matches were found, 1 if no matches were found, and 2
80 for syntax errors or inacessible files (even if matches were found).
84 Philip Hazel <ph10@cam.ac.uk>
86 Last updated: 15 August 2001
88 Copyright (c) 1997-2001 University of Cambridge.