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

Diff of /code/trunk/doc/pcregrep.1

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 150 by ph10, Tue Apr 17 08:22:40 2007 UTC revision 279 by ph10, Tue Dec 4 20:01:43 2007 UTC
# Line 23  without delimiters. For example: Line 23  without delimiters. For example:
23  .sp  .sp
24  If you attempt to use delimiters (for example, by surrounding a pattern with  If you attempt to use delimiters (for example, by surrounding a pattern with
25  slashes, as is common in Perl scripts), they are interpreted as part of the  slashes, as is common in Perl scripts), they are interpreted as part of the
26  pattern. Quotes can of course be used on the command line because they are  pattern. Quotes can of course be used to delimit patterns on the command line
27  interpreted by the shell, and indeed they are required if a pattern contains  because they are interpreted by the shell, and indeed they are required if a
28  white space or shell metacharacters.  pattern contains white space or shell metacharacters.
29  .P  .P
30  The first argument that follows any option settings is treated as the single  The first argument that follows any option settings is treated as the single
31  pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present.  pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present.
# Line 41  For example: Line 41  For example:
41  .sp  .sp
42  By default, each line that matches the pattern is copied to the standard  By default, each line that matches the pattern is copied to the standard
43  output, and if there is more than one file, the file name is output at the  output, and if there is more than one file, the file name is output at the
44  start of each line. However, there are options that can change how  start of each line, followed by a colon. However, there are options that can
45  \fBpcregrep\fP behaves. In particular, the \fB-M\fP option makes it possible to  change how \fBpcregrep\fP behaves. In particular, the \fB-M\fP option makes it
46  search for patterns that span line boundaries. What defines a line boundary is  possible to search for patterns that span line boundaries. What defines a line
47  controlled by the \fB-N\fP (\fB--newline\fP) option.  boundary is controlled by the \fB-N\fP (\fB--newline\fP) option.
48  .P  .P
49  Patterns are limited to 8K or BUFSIZ characters, whichever is the greater.  Patterns are limited to 8K or BUFSIZ characters, whichever is the greater.
50  BUFSIZ is defined in \fB<stdio.h>\fP.  BUFSIZ is defined in \fB<stdio.h>\fP.
# Line 116  option), or "skip" (silently skip the pa Line 116  option), or "skip" (silently skip the pa
116  are read as if they were ordinary files. In some operating systems the effect  are read as if they were ordinary files. In some operating systems the effect
117  of reading a directory like this is an immediate end-of-file.  of reading a directory like this is an immediate end-of-file.
118  .TP  .TP
119  \fB-e\fP \fIpattern\fP, \fB--regex=\fP\fIpattern\fP,  \fB-e\fP \fIpattern\fP, \fB--regex=\fP\fIpattern\fP, \fB--regexp=\fP\fIpattern\fP
120  \fB--regexp=\fP\fIpattern\fP Specify a pattern to be matched. This option can  Specify a pattern to be matched. This option can be used multiple times in
121  be used multiple times in order to specify several patterns. It can also be  order to specify several patterns. It can also be used as a way of specifying a
122  used as a way of specifying a single pattern that starts with a hyphen. When  single pattern that starts with a hyphen. When \fB-e\fP is used, no argument
123  \fB-e\fP is used, no argument pattern is taken from the command line; all  pattern is taken from the command line; all arguments are treated as file
124  arguments are treated as file names. There is an overall maximum of 100  names. There is an overall maximum of 100 patterns. They are applied to each
125  patterns. They are applied to each line in the order in which they are defined  line in the order in which they are defined until one matches (or fails to
126  until one matches (or fails to match if \fB-v\fP is used). If \fB-f\fP is used  match if \fB-v\fP is used). If \fB-f\fP is used with \fB-e\fP, the command line
127  with \fB-e\fP, the command line patterns are matched first, followed by the  patterns are matched first, followed by the patterns from the file, independent
128  patterns from the file, independent of the order in which these options are  of the order in which these options are specified. Note that multiple use of
129  specified. Note that multiple use of \fB-e\fP is not the same as a single  \fB-e\fP is not the same as a single pattern with alternatives. For example,
130  pattern with alternatives. For example, X|Y finds the first character in a line  X|Y finds the first character in a line that is X or Y, whereas if the two
131  that is X or Y, whereas if the two patterns are given separately,  patterns are given separately, \fBpcregrep\fP finds X if it is present, even if
132  \fBpcregrep\fP finds X if it is present, even if it follows Y in the line. It  it follows Y in the line. It finds Y only if there is no X in the line. This
133  finds Y only if there is no X in the line. This really matters only if you are  really matters only if you are using \fB-o\fP to show the part(s) of the line
134  using \fB-o\fP to show the portion of the line that matched.  that matched.
135  .TP  .TP
136  \fB--exclude\fP=\fIpattern\fP  \fB--exclude\fP=\fIpattern\fP
137  When \fBpcregrep\fP is searching the files in a directory as a consequence of  When \fBpcregrep\fP is searching the files in a directory as a consequence of
# Line 246  the filename is also being output, it pr Line 246  the filename is also being output, it pr
246  \fB-o\fP, \fB--only-matching\fP  \fB-o\fP, \fB--only-matching\fP
247  Show only the part of the line that matched a pattern. In this mode, no  Show only the part of the line that matched a pattern. In this mode, no
248  context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are  context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are
249  ignored.  ignored. If there is more than one match in a line, each of them is shown
250    separately. If \fB-o\fP is combined with \fB-v\fP (invert the sense of the
251    match to find non-matching lines), no output is generated, but the return code
252    is set appropriately.
253  .TP  .TP
254  \fB-q\fP, \fB--quiet\fP  \fB-q\fP, \fB--quiet\fP
255  Work quietly, that is, display nothing except error messages. The exit  Work quietly, that is, display nothing except error messages. The exit
# Line 388  Cambridge CB2 3QH, England. Line 391  Cambridge CB2 3QH, England.
391  .rs  .rs
392  .sp  .sp
393  .nf  .nf
394  Last updated: 16 April 2007  Last updated: 04 December 2007
395  Copyright (c) 1997-2007 University of Cambridge.  Copyright (c) 1997-2007 University of Cambridge.
396  .fi  .fi

Legend:
Removed from v.150  
changed lines
  Added in v.279

  ViewVC Help
Powered by ViewVC 1.1.5