/[pcre]/code/trunk/doc/pcregrep.html
ViewVC logotype

Contents of /code/trunk/doc/pcregrep.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (hide annotations) (download) (as text)
Sat Feb 24 21:39:46 2007 UTC (6 years, 3 months ago) by nigel
File MIME type: text/html
File size: 4564 byte(s)
Load pcre-3.6 into code/trunk.

1 nigel 49 <HTML>
2     <HEAD>
3     <TITLE>pcregrep specification</TITLE>
4     </HEAD>
5     <body bgcolor="#FFFFFF" text="#00005A">
6     <H1>pcregrep specification</H1>
7     This HTML document has been generated automatically from the original man page.
8     If there is any nonsense in it, please consult the man page in case the
9     conversion went wrong.
10     <UL>
11     <LI><A NAME="TOC1" HREF="#SEC1">NAME</A>
12     <LI><A NAME="TOC2" HREF="#SEC2">SYNOPSIS</A>
13     <LI><A NAME="TOC3" HREF="#SEC3">DESCRIPTION</A>
14     <LI><A NAME="TOC4" HREF="#SEC4">OPTIONS</A>
15     <LI><A NAME="TOC5" HREF="#SEC5">SEE ALSO</A>
16     <LI><A NAME="TOC6" HREF="#SEC6">DIAGNOSTICS</A>
17     <LI><A NAME="TOC7" HREF="#SEC7">AUTHOR</A>
18     </UL>
19     <LI><A NAME="SEC1" HREF="#TOC1">NAME</A>
20     <P>
21     pcregrep - a grep with Perl-compatible regular expressions.
22     </P>
23     <LI><A NAME="SEC2" HREF="#TOC1">SYNOPSIS</A>
24     <P>
25 nigel 53 <B>pcregrep [-Vcfhilnrsvx] pattern [file] ...</B>
26 nigel 49 </P>
27     <LI><A NAME="SEC3" HREF="#TOC1">DESCRIPTION</A>
28     <P>
29     <B>pcregrep</B> searches files for character patterns, in the same way as other
30     grep commands do, but it uses the PCRE regular expression library to support
31     patterns that are compatible with the regular expressions of Perl 5. See
32     <B>pcre(3)</B> for a full description of syntax and semantics.
33     </P>
34     <P>
35     If no files are specified, <B>pcregrep</B> reads the standard input. By default,
36     each line that matches the pattern is copied to the standard output, and if
37     there is more than one file, the file name is printed before each line of
38     output. However, there are options that can change how <B>pcregrep</B> behaves.
39     </P>
40     <P>
41     Lines are limited to BUFSIZ characters. BUFSIZ is defined in <B>&#60;stdio.h&#62;</B>.
42     The newline character is removed from the end of each line before it is matched
43     against the pattern.
44     </P>
45     <LI><A NAME="SEC4" HREF="#TOC1">OPTIONS</A>
46     <P>
47     <B>-V</B>
48     Write the version number of the PCRE library being used to the standard error
49     stream.
50     </P>
51     <P>
52     <B>-c</B>
53     Do not print individual lines; instead just print a count of the number of
54     lines that would otherwise have been printed. If several files are given, a
55     count is printed for each of them.
56     </P>
57     <P>
58 nigel 55 <PRE>
59     versity of Cambridge for use on Unix systems connected to
60     the Internet. It is freely available under the terms of
61     the GNU General Public Licence. In style it is similar to
62     Smail 3, but its facilities are more extensive, and in
63     particular it has some defences against mail bombs and
64     unsolicited junk mail, in the form of options for refusing
65     messages from particular hosts, networks, or senders.
66     </PRE>
67     </P>
68     <P>
69     <PRE>
70     Exim's command line takes the standard Unix form of a
71     sequence of options, each starting with a hyphen charac\fB-f<I>filename</I>
72     </PRE>
73 nigel 53 Read patterns from the file, one per line, and match all patterns against each
74     line. There is a maximum of 100 patterns. Trailing white space is removed, and
75     blank lines are ignored. An empty file contains no patterns and therefore
76     matches nothing.
77     </P>
78     <P>
79 nigel 49 <B>-h</B>
80     Suppress printing of filenames when searching multiple files.
81     </P>
82     <P>
83     <B>-i</B>
84     Ignore upper/lower case distinctions during comparisons.
85     </P>
86     <P>
87     <B>-l</B>
88     Instead of printing lines from the files, just print the names of the files
89     containing lines that would have been printed. Each file name is printed
90     once, on a separate line.
91     </P>
92     <P>
93     <B>-n</B>
94     Precede each line by its line number in the file.
95     </P>
96     <P>
97 nigel 53 <B>-r</B>
98     If any file is a directory, recursively scan the files it contains. Without
99     <B>-r</B> a directory is scanned as a normal file.
100     </P>
101     <P>
102 nigel 49 <B>-s</B>
103     Work silently, that is, display nothing except error messages.
104     The exit status indicates whether any matches were found.
105     </P>
106     <P>
107     <B>-v</B>
108     Invert the sense of the match, so that lines which do <I>not</I> match the
109     pattern are now the ones that are found.
110     </P>
111     <P>
112     <B>-x</B>
113     Force the pattern to be anchored (it must start matching at the beginning of
114     the line) and in addition, require it to match the entire line. This is
115     equivalent to having ^ and $ characters at the start and end of each
116     alternative branch in the regular expression.
117     </P>
118     <LI><A NAME="SEC5" HREF="#TOC1">SEE ALSO</A>
119     <P>
120     <B>pcre(3)</B>, Perl 5 documentation
121     </P>
122     <LI><A NAME="SEC6" HREF="#TOC1">DIAGNOSTICS</A>
123     <P>
124     Exit status is 0 if any matches were found, 1 if no matches were found, and 2
125     for syntax errors or inacessible files (even if matches were found).
126     </P>
127     <LI><A NAME="SEC7" HREF="#TOC1">AUTHOR</A>
128     <P>
129     Philip Hazel &#60;ph10@cam.ac.uk&#62;
130 nigel 53 </P>
131     <P>
132     Last updated: 15 August 2001
133 nigel 49 <BR>
134 nigel 53 Copyright (c) 1997-2001 University of Cambridge.

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12