pcre: Improve sanity check in read_repeat_counts()
[privoxy.git] / pcre / doc / pcregrep.1
1 .TH PCREGREP 1\r
2 .SH NAME\r
3 pcregrep - a grep with Perl-compatible regular expressions.\r
4 .SH SYNOPSIS\r
5 .B pcregrep [-Vchilnsvx] pattern [file] ...\r
6 \r
7 \r
8 .SH DESCRIPTION\r
9 \fBpcregrep\fR searches files for character patterns, in the same way as other\r
10 grep commands do, but it uses the PCRE regular expression library to support\r
11 patterns that are compatible with the regular expressions of Perl 5. See\r
12 \fBpcre(3)\fR for a full description of syntax and semantics.\r
13 \r
14 If no files are specified, \fBpcregrep\fR reads the standard input. By default,\r
15 each line that matches the pattern is copied to the standard output, and if\r
16 there is more than one file, the file name is printed before each line of\r
17 output. However, there are options that can change how \fBpcregrep\fR behaves.\r
18 \r
19 Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB<stdio.h>\fR.\r
20 The newline character is removed from the end of each line before it is matched\r
21 against the pattern.\r
22 \r
23 \r
24 .SH OPTIONS\r
25 .TP 10\r
26 \fB-V\fR\r
27 Write the version number of the PCRE library being used to the standard error\r
28 stream.\r
29 .TP\r
30 \fB-c\fR\r
31 Do not print individual lines; instead just print a count of the number of\r
32 lines that would otherwise have been printed. If several files are given, a\r
33 count is printed for each of them.\r
34 .TP\r
35 \fB-h\fR\r
36 Suppress printing of filenames when searching multiple files.\r
37 .TP\r
38 \fB-i\fR\r
39 Ignore upper/lower case distinctions during comparisons.\r
40 .TP\r
41 \fB-l\fR\r
42 Instead of printing lines from the files, just print the names of the files\r
43 containing lines that would have been printed. Each file name is printed\r
44 once, on a separate line.\r
45 .TP\r
46 \fB-n\fR\r
47 Precede each line by its line number in the file.\r
48 .TP\r
49 \fB-s\fR\r
50 Work silently, that is, display nothing except error messages.\r
51 The exit status indicates whether any matches were found.\r
52 .TP\r
53 \fB-v\fR\r
54 Invert the sense of the match, so that lines which do \fInot\fR match the\r
55 pattern are now the ones that are found.\r
56 .TP\r
57 \fB-x\fR\r
58 Force the pattern to be anchored (it must start matching at the beginning of\r
59 the line) and in addition, require it to match the entire line. This is\r
60 equivalent to having ^ and $ characters at the start and end of each\r
61 alternative branch in the regular expression.\r
62 \r
63 \r
64 .SH SEE ALSO\r
65 \fBpcre(3)\fR, Perl 5 documentation\r
66 \r
67 \r
68 .SH DIAGNOSTICS\r
69 Exit status is 0 if any matches were found, 1 if no matches were found, and 2\r
70 for syntax errors or inacessible files (even if matches were found).\r
71 \r
72 \r
73 .SH AUTHOR\r
74 Philip Hazel <ph10@cam.ac.uk>\r
75 .br\r
76 Copyright (c) 1997-2000 University of Cambridge.\r