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