/[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 570 by ph10, Sun Oct 31 18:18:48 2010 UTC revision 571 by ph10, Tue Nov 16 17:51:37 2010 UTC
# Line 182  that matched. Line 182  that matched.
182  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
183  the \fB-r\fP (recursive search) option, any regular files whose names match the  the \fB-r\fP (recursive search) option, any regular files whose names match the
184  pattern are excluded. Subdirectories are not excluded by this option; they are  pattern are excluded. Subdirectories are not excluded by this option; they are
185  searched recursively, subject to the \fB--exclude_dir\fP and  searched recursively, subject to the \fB--exclude-dir\fP and
186  \fB--include_dir\fP options. The pattern is a PCRE regular expression, and is  \fB--include_dir\fP options. The pattern is a PCRE regular expression, and is
187  matched against the final component of the file name (not the entire path). If  matched against the final component of the file name (not the entire path). If
188  a file name matches both \fB--include\fP and \fB--exclude\fP, it is excluded.  a file name matches both \fB--include\fP and \fB--exclude\fP, it is excluded.
189  There is no short form for this option.  There is no short form for this option.
190  .TP  .TP
191  \fB--exclude_dir\fP=\fIpattern\fP  \fB--exclude-dir\fP=\fIpattern\fP
192  When \fBpcregrep\fP is searching the contents of a directory as a consequence  When \fBpcregrep\fP is searching the contents of a directory as a consequence
193  of the \fB-r\fP (recursive search) option, any subdirectories whose names match  of the \fB-r\fP (recursive search) option, any subdirectories whose names match
194  the pattern are excluded. (Note that the \fP--exclude\fP option does not affect  the pattern are excluded. (Note that the \fP--exclude\fP option does not affect
195  subdirectories.) The pattern is a PCRE regular expression, and is matched  subdirectories.) The pattern is a PCRE regular expression, and is matched
196  against the final component of the name (not the entire path). If a  against the final component of the name (not the entire path). If a
197  subdirectory name matches both \fB--include_dir\fP and \fB--exclude_dir\fP, it  subdirectory name matches both \fB--include-dir\fP and \fB--exclude-dir\fP, it
198  is excluded. There is no short form for this option.  is excluded. There is no short form for this option.
199  .TP  .TP
200  \fB-F\fP, \fB--fixed-strings\fP  \fB-F\fP, \fB--fixed-strings\fP
# Line 248  Ignore upper/lower case distinctions dur Line 248  Ignore upper/lower case distinctions dur
248  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
249  the \fB-r\fP (recursive search) option, only those regular files whose names  the \fB-r\fP (recursive search) option, only those regular files whose names
250  match the pattern are included. Subdirectories are always included and searched  match the pattern are included. Subdirectories are always included and searched
251  recursively, subject to the \fP--include_dir\fP and \fB--exclude_dir\fP  recursively, subject to the \fP--include-dir\fP and \fB--exclude-dir\fP
252  options. The pattern is a PCRE regular expression, and is matched against the  options. The pattern is a PCRE regular expression, and is matched against the
253  final component of the file name (not the entire path). If a file name matches  final component of the file name (not the entire path). If a file name matches
254  both \fB--include\fP and \fB--exclude\fP, it is excluded. There is no short  both \fB--include\fP and \fB--exclude\fP, it is excluded. There is no short
255  form for this option.  form for this option.
256  .TP  .TP
257  \fB--include_dir\fP=\fIpattern\fP  \fB--include-dir\fP=\fIpattern\fP
258  When \fBpcregrep\fP is searching the contents of a directory as a consequence  When \fBpcregrep\fP is searching the contents of a directory as a consequence
259  of the \fB-r\fP (recursive search) option, only those subdirectories whose  of the \fB-r\fP (recursive search) option, only those subdirectories whose
260  names match the pattern are included. (Note that the \fB--include\fP option  names match the pattern are included. (Note that the \fB--include\fP option
261  does not affect subdirectories.) The pattern is a PCRE regular expression, and  does not affect subdirectories.) The pattern is a PCRE regular expression, and
262  is matched against the final component of the name (not the entire path). If a  is matched against the final component of the name (not the entire path). If a
263  subdirectory name matches both \fB--include_dir\fP and \fB--exclude_dir\fP, it  subdirectory name matches both \fB--include-dir\fP and \fB--exclude-dir\fP, it
264  is excluded. There is no short form for this option.  is excluded. There is no short form for this option.
265  .TP  .TP
266  \fB-L\fP, \fB--files-without-match\fP  \fB-L\fP, \fB--files-without-match\fP
# Line 458  convert this to an appropriate sequence Line 458  convert this to an appropriate sequence
458  .SH "OPTIONS COMPATIBILITY"  .SH "OPTIONS COMPATIBILITY"
459  .rs  .rs
460  .sp  .sp
461  The majority of short and long forms of \fBpcregrep\fP's options are the same  Many of the short and long forms of \fBpcregrep\fP's options are the same
462  as in the GNU \fBgrep\fP program. Any long option of the form  as in the GNU \fBgrep\fP program (version 2.5.4). Any long option of the form
463  \fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP  \fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
464  (PCRE terminology). However, the \fB--locale\fP, \fB-M\fP, \fB--multiline\fP,  (PCRE terminology). However, the \fB--file-offsets\fP, \fB--include-dir\fP,
465  \fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP. If both the  \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, \fB-M\fP,
466    \fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--recursion-limit\fP,
467    \fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP, as is the
468    use of the \fB--only-matching\fP option with a capturing parentheses number.
469    .P
470    Although most of the common options work the same way, a few are different in
471    \fBpcregrep\fP. For example, the \fB--include\fP option's argument is a glob
472    for GNU \fBgrep\fP, but a regular expression for \fBpcregrep\fP. If both the
473  \fB-c\fP and \fB-l\fP options are given, GNU grep lists only file names,  \fB-c\fP and \fB-l\fP options are given, GNU grep lists only file names,
474  without counts, but \fBpcregrep\fP gives the counts.  without counts, but \fBpcregrep\fP gives the counts.
475  .  .
# Line 471  without counts, but \fBpcregrep\fP gives Line 478  without counts, but \fBpcregrep\fP gives
478  .rs  .rs
479  .sp  .sp
480  There are four different ways in which an option with data can be specified.  There are four different ways in which an option with data can be specified.
481  If a short form option is used, the data may follow immediately, or in the next  If a short form option is used, the data may follow immediately, or (with one
482  command line item. For example:  exception) in the next command line item. For example:
483  .sp  .sp
484    -f/some/file    -f/some/file
485    -f /some/file    -f /some/file
486  .sp  .sp
487    The exception is the \fB-o\fP option, which may appear with or without data.
488    Because of this, if data is present, it must follow immediately in the same
489    item, for example -o3.
490    .P
491  If a long form option is used, the data may appear in the same command line  If a long form option is used, the data may appear in the same command line
492  item, separated by an equals character, or (with one exception) it may appear  item, separated by an equals character, or (with two exceptions) it may appear
493  in the next command line item. For example:  in the next command line item. For example:
494  .sp  .sp
495    --file=/some/file    --file=/some/file
# Line 489  in a shell command, and have the shell e Line 500  in a shell command, and have the shell e
500  separate the file name from the option, because the shell does not treat ~  separate the file name from the option, because the shell does not treat ~
501  specially unless it is at the start of an item.  specially unless it is at the start of an item.
502  .P  .P
503  The exception to the above is the \fB--colour\fP (or \fB--color\fP) option,  The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and
504  for which the data is optional. If this option does have data, it must be given  \fB--only-matching\fP options, for which the data is optional. If one of these
505  in the first form, using an equals character. Otherwise it will be assumed that  options does have data, it must be given in the first form, using an equals
506  it has no data.  character. Otherwise \fBpcregrep\P will assume that it has no data.
507  .  .
508  .  .
509  .SH "MATCHING ERRORS"  .SH "MATCHING ERRORS"
# Line 505  digit. The PCRE matching function has a Line 516  digit. The PCRE matching function has a
516  in these circumstances. If this happens, \fBpcregrep\fP outputs an error  in these circumstances. If this happens, \fBpcregrep\fP outputs an error
517  message and the line that caused the problem to the standard error stream. If  message and the line that caused the problem to the standard error stream. If
518  there are more than 20 such errors, \fBpcregrep\fP gives up.  there are more than 20 such errors, \fBpcregrep\fP gives up.
519    .P
520    The \fB--match-limit\fP option of \fBpcregrep\fP can be used to set the overall
521    resource limit; there is a second option called \fB--recursion-limit\fP that
522    sets a limit on the amount of memory (usually stack) that is used (see the
523    discussion of these options above).
524  .  .
525  .  .
526  .SH DIAGNOSTICS  .SH DIAGNOSTICS
# Line 537  Cambridge CB2 3QH, England. Line 553  Cambridge CB2 3QH, England.
553  .rs  .rs
554  .sp  .sp
555  .nf  .nf
556  Last updated: 31 October 2010  Last updated: 16 November 2010
557  Copyright (c) 1997-2010 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
558  .fi  .fi

Legend:
Removed from v.570  
changed lines
  Added in v.571

  ViewVC Help
Powered by ViewVC 1.1.5