/[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 90 by nigel, Sat Feb 24 21:41:21 2007 UTC revision 91 by nigel, Sat Feb 24 21:41:34 2007 UTC
# Line 17  man page, in case the conversion went wr Line 17  man page, in case the conversion went wr
17  <li><a name="TOC2" href="#SEC2">DESCRIPTION</a>  <li><a name="TOC2" href="#SEC2">DESCRIPTION</a>
18  <li><a name="TOC3" href="#SEC3">OPTIONS</a>  <li><a name="TOC3" href="#SEC3">OPTIONS</a>
19  <li><a name="TOC4" href="#SEC4">ENVIRONMENT VARIABLES</a>  <li><a name="TOC4" href="#SEC4">ENVIRONMENT VARIABLES</a>
20  <li><a name="TOC5" href="#SEC5">OPTIONS COMPATIBILITY</a>  <li><a name="TOC5" href="#SEC5">NEWLINES</a>
21  <li><a name="TOC6" href="#SEC6">OPTIONS WITH DATA</a>  <li><a name="TOC6" href="#SEC6">OPTIONS COMPATIBILITY</a>
22  <li><a name="TOC7" href="#SEC7">MATCHING ERRORS</a>  <li><a name="TOC7" href="#SEC7">OPTIONS WITH DATA</a>
23  <li><a name="TOC8" href="#SEC8">DIAGNOSTICS</a>  <li><a name="TOC8" href="#SEC8">MATCHING ERRORS</a>
24  <li><a name="TOC9" href="#SEC9">AUTHOR</a>  <li><a name="TOC9" href="#SEC9">DIAGNOSTICS</a>
25    <li><a name="TOC10" href="#SEC10">AUTHOR</a>
26  </ul>  </ul>
27  <br><a name="SEC1" href="#TOC1">SYNOPSIS</a><br>  <br><a name="SEC1" href="#TOC1">SYNOPSIS</a><br>
28  <P>  <P>
# Line 66  By default, each line that matches the p Line 67  By default, each line that matches the p
67  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
68  start of each line. However, there are options that can change how  start of each line. However, there are options that can change how
69  <b>pcregrep</b> behaves. In particular, the <b>-M</b> option makes it possible to  <b>pcregrep</b> behaves. In particular, the <b>-M</b> option makes it possible to
70  search for patterns that span line boundaries.  search for patterns that span line boundaries. What defines a line boundary is
71    controlled by the <b>-N</b> (<b>--newline</b>) option.
72  </P>  </P>
73  <P>  <P>
74  Patterns are limited to 8K or BUFSIZ characters, whichever is the greater.  Patterns are limited to 8K or BUFSIZ characters, whichever is the greater.
# Line 265  the previous 8K characters (or all the p Line 267  the previous 8K characters (or all the p
267  are guaranteed to be available for lookbehind assertions.  are guaranteed to be available for lookbehind assertions.
268  </P>  </P>
269  <P>  <P>
270    <b>-N</b> <i>newline-type</i>, <b>--newline=</b><i>newline-type</i>
271    The PCRE library supports three different character sequences for indicating
272    the ends of lines. They are the single-character sequences CR (carriage return)
273    and LF (linefeed), and the two-character sequence CR, LF. When the library is
274    built, a default line-ending sequence is specified. This is normally the
275    standard sequence for the operating system. Unless otherwise specified by this
276    option, <b>pcregrep</b> uses the default. The possible values for this option
277    are CR, LF, or CRLF. This makes it possible to use <b>pcregrep</b> on files that
278    have come from other environments without having to modify their line endings.
279    If the data that is being scanned does not agree with the convention set by
280    this option, <b>pcregrep</b> may behave in strange ways.
281    </P>
282    <P>
283  <b>-n</b>, <b>--line-number</b>  <b>-n</b>, <b>--line-number</b>
284  Precede each output line by its line number in the file, followed by a colon  Precede each output line by its line number in the file, followed by a colon
285  and a space for matching lines or a hyphen and a space for context lines. If  and a space for matching lines or a hyphen and a space for context lines. If
# Line 330  order, for a locale. The first one that Line 345  order, for a locale. The first one that
345  by the <b>--locale</b> option. If no locale is set, the PCRE library's default  by the <b>--locale</b> option. If no locale is set, the PCRE library's default
346  (usually the "C" locale) is used.  (usually the "C" locale) is used.
347  </P>  </P>
348  <br><a name="SEC5" href="#TOC1">OPTIONS COMPATIBILITY</a><br>  <br><a name="SEC5" href="#TOC1">NEWLINES</a><br>
349    <P>
350    The <b>-N</b> (<b>--newline</b>) option allows <b>pcregrep</b> to scan files with
351    different newline conventions from the default. However, the setting of this
352    option does not affect the way in which <b>pcregrep</b> writes information to
353    the standard error and output streams. It uses the string "\n" in C
354    <b>printf()</b> calls to indicate newlines, relying on the C I/O library to
355    convert this to an appropriate sequence if the output is sent to a file.
356    </P>
357    <br><a name="SEC6" href="#TOC1">OPTIONS COMPATIBILITY</a><br>
358  <P>  <P>
359  The majority of short and long forms of <b>pcregrep</b>'s options are the same  The majority of short and long forms of <b>pcregrep</b>'s options are the same
360  as in the GNU <b>grep</b> program. Any long option of the form  as in the GNU <b>grep</b> program. Any long option of the form
# Line 338  as in the GNU <b>grep</b> program. Any l Line 362  as in the GNU <b>grep</b> program. Any l
362  (PCRE terminology). However, the <b>--locale</b>, <b>-M</b>, <b>--multiline</b>,  (PCRE terminology). However, the <b>--locale</b>, <b>-M</b>, <b>--multiline</b>,
363  <b>-u</b>, and <b>--utf-8</b> options are specific to <b>pcregrep</b>.  <b>-u</b>, and <b>--utf-8</b> options are specific to <b>pcregrep</b>.
364  </P>  </P>
365  <br><a name="SEC6" href="#TOC1">OPTIONS WITH DATA</a><br>  <br><a name="SEC7" href="#TOC1">OPTIONS WITH DATA</a><br>
366  <P>  <P>
367  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.
368  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 in the next
# Line 365  for which the data is optional. If this Line 389  for which the data is optional. If this
389  in the first form, using an equals character. Otherwise it will be assumed that  in the first form, using an equals character. Otherwise it will be assumed that
390  it has no data.  it has no data.
391  </P>  </P>
392  <br><a name="SEC7" href="#TOC1">MATCHING ERRORS</a><br>  <br><a name="SEC8" href="#TOC1">MATCHING ERRORS</a><br>
393  <P>  <P>
394  It is possible to supply a regular expression that takes a very long time to  It is possible to supply a regular expression that takes a very long time to
395  fail to match certain lines. Such patterns normally involve nested indefinite  fail to match certain lines. Such patterns normally involve nested indefinite
# Line 375  in these circumstances. If this happens, Line 399  in these circumstances. If this happens,
399  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
400  there are more than 20 such errors, <b>pcregrep</b> gives up.  there are more than 20 such errors, <b>pcregrep</b> gives up.
401  </P>  </P>
402  <br><a name="SEC8" href="#TOC1">DIAGNOSTICS</a><br>  <br><a name="SEC9" href="#TOC1">DIAGNOSTICS</a><br>
403  <P>  <P>
404  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
405  for syntax errors and non-existent or inacessible files (even if matches were  for syntax errors and non-existent or inacessible files (even if matches were
# Line 383  found in other files) or too many matchi Line 407  found in other files) or too many matchi
407  suppress error messages about inaccessble files does not affect the return  suppress error messages about inaccessble files does not affect the return
408  code.  code.
409  </P>  </P>
410  <br><a name="SEC9" href="#TOC1">AUTHOR</a><br>  <br><a name="SEC10" href="#TOC1">AUTHOR</a><br>
411  <P>  <P>
412  Philip Hazel  Philip Hazel
413  <br>  <br>
# Line 392  University Computing Service Line 416  University Computing Service
416  Cambridge CB2 3QG, England.  Cambridge CB2 3QG, England.
417  </P>  </P>
418  <P>  <P>
419  Last updated: 23 January 2006  Last updated: 06 June 2006
420  <br>  <br>
421  Copyright &copy; 1997-2006 University of Cambridge.  Copyright &copy; 1997-2006 University of Cambridge.
422  <p>  <p>

Legend:
Removed from v.90  
changed lines
  Added in v.91

  ViewVC Help
Powered by ViewVC 1.1.5