| 1 |
<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 |
<B>pcregrep [-Vchilnsvx] pattern [file] ...</B>
|
| 26 |
</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><stdio.h></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 |
<B>-h</B>
|
| 59 |
Suppress printing of filenames when searching multiple files.
|
| 60 |
</P>
|
| 61 |
<P>
|
| 62 |
<B>-i</B>
|
| 63 |
Ignore upper/lower case distinctions during comparisons.
|
| 64 |
</P>
|
| 65 |
<P>
|
| 66 |
<B>-l</B>
|
| 67 |
Instead of printing lines from the files, just print the names of the files
|
| 68 |
containing lines that would have been printed. Each file name is printed
|
| 69 |
once, on a separate line.
|
| 70 |
</P>
|
| 71 |
<P>
|
| 72 |
<B>-n</B>
|
| 73 |
Precede each line by its line number in the file.
|
| 74 |
</P>
|
| 75 |
<P>
|
| 76 |
<B>-s</B>
|
| 77 |
Work silently, that is, display nothing except error messages.
|
| 78 |
The exit status indicates whether any matches were found.
|
| 79 |
</P>
|
| 80 |
<P>
|
| 81 |
<B>-v</B>
|
| 82 |
Invert the sense of the match, so that lines which do <I>not</I> match the
|
| 83 |
pattern are now the ones that are found.
|
| 84 |
</P>
|
| 85 |
<P>
|
| 86 |
<B>-x</B>
|
| 87 |
Force the pattern to be anchored (it must start matching at the beginning of
|
| 88 |
the line) and in addition, require it to match the entire line. This is
|
| 89 |
equivalent to having ^ and $ characters at the start and end of each
|
| 90 |
alternative branch in the regular expression.
|
| 91 |
</P>
|
| 92 |
<LI><A NAME="SEC5" HREF="#TOC1">SEE ALSO</A>
|
| 93 |
<P>
|
| 94 |
<B>pcre(3)</B>, Perl 5 documentation
|
| 95 |
</P>
|
| 96 |
<LI><A NAME="SEC6" HREF="#TOC1">DIAGNOSTICS</A>
|
| 97 |
<P>
|
| 98 |
Exit status is 0 if any matches were found, 1 if no matches were found, and 2
|
| 99 |
for syntax errors or inacessible files (even if matches were found).
|
| 100 |
</P>
|
| 101 |
<LI><A NAME="SEC7" HREF="#TOC1">AUTHOR</A>
|
| 102 |
<P>
|
| 103 |
Philip Hazel <ph10@cam.ac.uk>
|
| 104 |
<BR>
|
| 105 |
Copyright (c) 1997-2000 University of Cambridge.
|