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

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

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

revision 571 by ph10, Sat Nov 6 17:10:00 2010 UTC revision 572 by ph10, Wed Nov 17 17:55:57 2010 UTC
# Line 224  that matched. Line 224  that matched.
224  When <b>pcregrep</b> is searching the files in a directory as a consequence of  When <b>pcregrep</b> is searching the files in a directory as a consequence of
225  the <b>-r</b> (recursive search) option, any regular files whose names match the  the <b>-r</b> (recursive search) option, any regular files whose names match the
226  pattern are excluded. Subdirectories are not excluded by this option; they are  pattern are excluded. Subdirectories are not excluded by this option; they are
227  searched recursively, subject to the <b>--exclude_dir</b> and  searched recursively, subject to the <b>--exclude-dir</b> and
228  <b>--include_dir</b> options. The pattern is a PCRE regular expression, and is  <b>--include_dir</b> options. The pattern is a PCRE regular expression, and is
229  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
230  a file name matches both <b>--include</b> and <b>--exclude</b>, it is excluded.  a file name matches both <b>--include</b> and <b>--exclude</b>, it is excluded.
231  There is no short form for this option.  There is no short form for this option.
232  </P>  </P>
233  <P>  <P>
234  <b>--exclude_dir</b>=<i>pattern</i>  <b>--exclude-dir</b>=<i>pattern</i>
235  When <b>pcregrep</b> is searching the contents of a directory as a consequence  When <b>pcregrep</b> is searching the contents of a directory as a consequence
236  of the <b>-r</b> (recursive search) option, any subdirectories whose names match  of the <b>-r</b> (recursive search) option, any subdirectories whose names match
237  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
238  subdirectories.) The pattern is a PCRE regular expression, and is matched  subdirectories.) The pattern is a PCRE regular expression, and is matched
239  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
240  subdirectory name matches both <b>--include_dir</b> and <b>--exclude_dir</b>, it  subdirectory name matches both <b>--include-dir</b> and <b>--exclude-dir</b>, it
241  is excluded. There is no short form for this option.  is excluded. There is no short form for this option.
242  </P>  </P>
243  <P>  <P>
# Line 299  Ignore upper/lower case distinctions dur Line 299  Ignore upper/lower case distinctions dur
299  When <b>pcregrep</b> is searching the files in a directory as a consequence of  When <b>pcregrep</b> is searching the files in a directory as a consequence of
300  the <b>-r</b> (recursive search) option, only those regular files whose names  the <b>-r</b> (recursive search) option, only those regular files whose names
301  match the pattern are included. Subdirectories are always included and searched  match the pattern are included. Subdirectories are always included and searched
302  recursively, subject to the \fP--include_dir\fP and <b>--exclude_dir</b>  recursively, subject to the \fP--include-dir\fP and <b>--exclude-dir</b>
303  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
304  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
305  both <b>--include</b> and <b>--exclude</b>, it is excluded. There is no short  both <b>--include</b> and <b>--exclude</b>, it is excluded. There is no short
306  form for this option.  form for this option.
307  </P>  </P>
308  <P>  <P>
309  <b>--include_dir</b>=<i>pattern</i>  <b>--include-dir</b>=<i>pattern</i>
310  When <b>pcregrep</b> is searching the contents of a directory as a consequence  When <b>pcregrep</b> is searching the contents of a directory as a consequence
311  of the <b>-r</b> (recursive search) option, only those subdirectories whose  of the <b>-r</b> (recursive search) option, only those subdirectories whose
312  names match the pattern are included. (Note that the <b>--include</b> option  names match the pattern are included. (Note that the <b>--include</b> option
313  does not affect subdirectories.) The pattern is a PCRE regular expression, and  does not affect subdirectories.) The pattern is a PCRE regular expression, and
314  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
315  subdirectory name matches both <b>--include_dir</b> and <b>--exclude_dir</b>, it  subdirectory name matches both <b>--include-dir</b> and <b>--exclude-dir</b>, it
316  is excluded. There is no short form for this option.  is excluded. There is no short form for this option.
317  </P>  </P>
318  <P>  <P>
# Line 529  convert this to an appropriate sequence Line 529  convert this to an appropriate sequence
529  </P>  </P>
530  <br><a name="SEC7" href="#TOC1">OPTIONS COMPATIBILITY</a><br>  <br><a name="SEC7" href="#TOC1">OPTIONS COMPATIBILITY</a><br>
531  <P>  <P>
532  The majority of short and long forms of <b>pcregrep</b>'s options are the same  Many of the short and long forms of <b>pcregrep</b>'s options are the same
533  as in the GNU <b>grep</b> program. Any long option of the form  as in the GNU <b>grep</b> program (version 2.5.4). Any long option of the form
534  <b>--xxx-regexp</b> (GNU terminology) is also available as <b>--xxx-regex</b>  <b>--xxx-regexp</b> (GNU terminology) is also available as <b>--xxx-regex</b>
535  (PCRE terminology). However, the <b>--locale</b>, <b>-M</b>, <b>--multiline</b>,  (PCRE terminology). However, the <b>--file-offsets</b>, <b>--include-dir</b>,
536  <b>-u</b>, and <b>--utf-8</b> options are specific to <b>pcregrep</b>. If both the  <b>--line-offsets</b>, <b>--locale</b>, <b>--match-limit</b>, <b>-M</b>,
537    <b>--multiline</b>, <b>-N</b>, <b>--newline</b>, <b>--recursion-limit</b>,
538    <b>-u</b>, and <b>--utf-8</b> options are specific to <b>pcregrep</b>, as is the
539    use of the <b>--only-matching</b> option with a capturing parentheses number.
540    </P>
541    <P>
542    Although most of the common options work the same way, a few are different in
543    <b>pcregrep</b>. For example, the <b>--include</b> option's argument is a glob
544    for GNU <b>grep</b>, but a regular expression for <b>pcregrep</b>. If both the
545  <b>-c</b> and <b>-l</b> options are given, GNU grep lists only file names,  <b>-c</b> and <b>-l</b> options are given, GNU grep lists only file names,
546  without counts, but <b>pcregrep</b> gives the counts.  without counts, but <b>pcregrep</b> gives the counts.
547  </P>  </P>
548  <br><a name="SEC8" href="#TOC1">OPTIONS WITH DATA</a><br>  <br><a name="SEC8" href="#TOC1">OPTIONS WITH DATA</a><br>
549  <P>  <P>
550  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.
551  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
552  command line item. For example:  exception) in the next command line item. For example:
553  <pre>  <pre>
554    -f/some/file    -f/some/file
555    -f /some/file    -f /some/file
556  </pre>  </pre>
557    The exception is the <b>-o</b> option, which may appear with or without data.
558    Because of this, if data is present, it must follow immediately in the same
559    item, for example -o3.
560    </P>
561    <P>
562  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
563  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
564  in the next command line item. For example:  in the next command line item. For example:
565  <pre>  <pre>
566    --file=/some/file    --file=/some/file
# Line 559  separate the file name from the option, Line 572  separate the file name from the option,
572  specially unless it is at the start of an item.  specially unless it is at the start of an item.
573  </P>  </P>
574  <P>  <P>
575  The exception to the above is the <b>--colour</b> (or <b>--color</b>) option,  The exceptions to the above are the <b>--colour</b> (or <b>--color</b>) and
576  for which the data is optional. If this option does have data, it must be given  <b>--only-matching</b> options, for which the data is optional. If one of these
577  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
578  it has no data.  character. Otherwise \fBpcregrep\P will assume that it has no data.
579  </P>  </P>
580  <br><a name="SEC9" href="#TOC1">MATCHING ERRORS</a><br>  <br><a name="SEC9" href="#TOC1">MATCHING ERRORS</a><br>
581  <P>  <P>
# Line 574  in these circumstances. If this happens, Line 587  in these circumstances. If this happens,
587  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
588  there are more than 20 such errors, <b>pcregrep</b> gives up.  there are more than 20 such errors, <b>pcregrep</b> gives up.
589  </P>  </P>
590    <P>
591    The <b>--match-limit</b> option of <b>pcregrep</b> can be used to set the overall
592    resource limit; there is a second option called <b>--recursion-limit</b> that
593    sets a limit on the amount of memory (usually stack) that is used (see the
594    discussion of these options above).
595    </P>
596  <br><a name="SEC10" href="#TOC1">DIAGNOSTICS</a><br>  <br><a name="SEC10" href="#TOC1">DIAGNOSTICS</a><br>
597  <P>  <P>
598  Exit status is 0 if any matches were found, 1 if no matches were found, and 2  Exit status is 0 if any matches were found, 1 if no matches were found, and 2
# Line 597  Cambridge CB2 3QH, England. Line 616  Cambridge CB2 3QH, England.
616  </P>  </P>
617  <br><a name="SEC13" href="#TOC1">REVISION</a><br>  <br><a name="SEC13" href="#TOC1">REVISION</a><br>
618  <P>  <P>
619  Last updated: 31 October 2010  Last updated: 16 November 2010
620  <br>  <br>
621  Copyright &copy; 1997-2010 University of Cambridge.  Copyright &copy; 1997-2010 University of Cambridge.
622  <br>  <br>

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

  ViewVC Help
Powered by ViewVC 1.1.5