/[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 1193 by ph10, Sat Jun 2 11:03:06 2012 UTC revision 1194 by ph10, Wed Oct 31 17:42:29 2012 UTC
# Line 50  without delimiters. For example: Line 50  without delimiters. For example:
50  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
51  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
52  pattern. Quotes can of course be used to delimit patterns on the command line  pattern. Quotes can of course be used to delimit patterns on the command line
53  because they are interpreted by the shell, and indeed they are required if a  because they are interpreted by the shell, and indeed quotes are required if a
54  pattern contains white space or shell metacharacters.  pattern contains white space or shell metacharacters.
55  </P>  </P>
56  <P>  <P>
# Line 83  used (to allow for buffering "before" an Line 83  used (to allow for buffering "before" an
83  line overflows the buffer.  line overflows the buffer.
84  </P>  </P>
85  <P>  <P>
86  Patterns are limited to 8K or BUFSIZ bytes, whichever is the greater. BUFSIZ is  Patterns can be no longer than 8K or BUFSIZ bytes, whichever is the greater.
87  defined in <b>&#60;stdio.h&#62;</b>. When there is more than one pattern (specified by  BUFSIZ is defined in <b>&#60;stdio.h&#62;</b>. When there is more than one pattern
88  the use of <b>-e</b> and/or <b>-f</b>), each pattern is applied to each line in  (specified by the use of <b>-e</b> and/or <b>-f</b>), each pattern is applied to
89  the order in which they are defined, except that all the <b>-e</b> patterns are  each line in the order in which they are defined, except that all the <b>-e</b>
90  tried before the <b>-f</b> patterns.  patterns are tried before the <b>-f</b> patterns.
91  </P>  </P>
92  <P>  <P>
93  By default, as soon as one pattern matches (or fails to match when <b>-v</b> is  By default, as soon as one pattern matches a line, no further patterns are
94  used), no further patterns are considered. However, if <b>--colour</b> (or  considered. However, if <b>--colour</b> (or <b>--color</b>) is used to colour the
95  <b>--color</b>) is used to colour the matching substrings, or if  matching substrings, or if <b>--only-matching</b>, <b>--file-offsets</b>, or
96  <b>--only-matching</b>, <b>--file-offsets</b>, or <b>--line-offsets</b> is used to  <b>--line-offsets</b> is used to output only the part of the line that matched
97  output only the part of the line that matched (either shown literally, or as an  (either shown literally, or as an offset), scanning resumes immediately
98  offset), scanning resumes immediately following the match, so that further  following the match, so that further matches on the same line can be found. If
99  matches on the same line can be found. If there are multiple patterns, they are  there are multiple patterns, they are all tried on the remainder of the line,
100  all tried on the remainder of the line, but patterns that follow the one that  but patterns that follow the one that matched are not tried on the earlier part
101  matched are not tried on the earlier part of the line.  of the line.
102  </P>  </P>
103  <P>  <P>
104  This is the same behaviour as GNU grep, but it does mean that the order in  This behaviour means that the order in which multiple patterns are specified
105  which multiple patterns are specified can affect the output when one of the  can affect the output when one of the above options is used. This is no longer
106  above options is used.  the same behaviour as GNU grep, which now manages to display earlier matches
107    for later patterns (as long as there is no overlap).
108  </P>  </P>
109  <P>  <P>
110  Patterns that can match an empty string are accepted, but empty string  Patterns that can match an empty string are accepted, but empty string
# Line 138  for a means of changing the way binary f Line 139  for a means of changing the way binary f
139  The order in which some of the options appear can affect the output. For  The order in which some of the options appear can affect the output. For
140  example, both the <b>-h</b> and <b>-l</b> options affect the printing of file  example, both the <b>-h</b> and <b>-l</b> options affect the printing of file
141  names. Whichever comes later in the command line will be the one that takes  names. Whichever comes later in the command line will be the one that takes
142  effect. Numerical values for options may be followed by K or M, to signify  effect. Similarly, except where noted below, if an option is given twice, the
143  multiplication by 1024 or 1024*1024 respectively.  later setting is used. Numerical values for options may be followed by K or M,
144    to signify multiplication by 1024 or 1024*1024 respectively.
145  </P>  </P>
146  <P>  <P>
147  <b>--</b>  <b>--</b>
# Line 235  it is to be processed. Valid values are Line 237  it is to be processed. Valid values are
237  <P>  <P>
238  <b>-d</b> <i>action</i>, <b>--directories=</b><i>action</i>  <b>-d</b> <i>action</i>, <b>--directories=</b><i>action</i>
239  If an input path is a directory, "action" specifies how it is to be processed.  If an input path is a directory, "action" specifies how it is to be processed.
240  Valid values are "read" (the default), "recurse" (equivalent to the <b>-r</b>  Valid values are "read" (the default in non-Windows environments, for
241  option), or "skip" (silently skip the path). In the default case, directories  compatibility with GNU grep), "recurse" (equivalent to the <b>-r</b> option), or
242  are read as if they were ordinary files. In some operating systems the effect  "skip" (silently skip the path, the default in Windows environments). In the
243  of reading a directory like this is an immediate end-of-file.  "read" case, directories are read as if they were ordinary files. In some
244    operating systems the effect of reading a directory like this is an immediate
245    end-of-file; in others it may provoke an error.
246  </P>  </P>
247  <P>  <P>
248  <b>-e</b> <i>pattern</i>, <b>--regex=</b><i>pattern</i>, <b>--regexp=</b><i>pattern</i>  <b>-e</b> <i>pattern</i>, <b>--regex=</b><i>pattern</i>, <b>--regexp=</b><i>pattern</i>
# Line 246  Specify a pattern to be matched. This op Line 250  Specify a pattern to be matched. This op
250  order to specify several patterns. It can also be used as a way of specifying a  order to specify several patterns. It can also be used as a way of specifying a
251  single pattern that starts with a hyphen. When <b>-e</b> is used, no argument  single pattern that starts with a hyphen. When <b>-e</b> is used, no argument
252  pattern is taken from the command line; all arguments are treated as file  pattern is taken from the command line; all arguments are treated as file
253  names. There is an overall maximum of 100 patterns. They are applied to each  names. There is no limit to the number of patterns. They are applied to each
254  line in the order in which they are defined until one matches (or fails to  line in the order in which they are defined until one matches.
255  match if <b>-v</b> is used). If <b>-f</b> is used with <b>-e</b>, the command line  <br>
256  patterns are matched first, followed by the patterns from the file, independent  <br>
257  of the order in which these options are specified. Note that multiple use of  If <b>-f</b> is used with <b>-e</b>, the command line patterns are matched first,
258  <b>-e</b> is not the same as a single pattern with alternatives. For example,  followed by the patterns from the file(s), independent of the order in which
259  X|Y finds the first character in a line that is X or Y, whereas if the two  these options are specified. Note that multiple use of <b>-e</b> is not the same
260  patterns are given separately, <b>pcregrep</b> finds X if it is present, even if  as a single pattern with alternatives. For example, X|Y finds the first
261  it follows Y in the line. It finds Y only if there is no X in the line. This  character in a line that is X or Y, whereas if the two patterns are given
262  really matters only if you are using <b>-o</b> to show the part(s) of the line  separately, with X first, <b>pcregrep</b> finds X if it is present, even if it
263  that matched.  follows Y in the line. It finds Y only if there is no X in the line. This
264    matters only if you are using <b>-o</b> or <b>--colo(u)r</b> to show the part(s)
265    of the line that matched.
266  </P>  </P>
267  <P>  <P>
268  <b>--exclude</b>=<i>pattern</i>  <b>--exclude</b>=<i>pattern</i>
269  When <b>pcregrep</b> is searching the files in a directory as a consequence of  Files (but not directories) whose names match the pattern are skipped without
270  the <b>-r</b> (recursive search) option, any regular files whose names match the  being processed. This applies to all files, whether listed on the command line,
271  pattern are excluded. Subdirectories are not excluded by this option; they are  obtained from <b>--file-list</b>, or by scanning a directory. The pattern is a
272  searched recursively, subject to the <b>--exclude-dir</b> and  PCRE regular expression, and is matched against the final component of the file
273  <b>--include_dir</b> options. The pattern is a PCRE regular expression, and is  name, not the entire path. The <b>-F</b>, <b>-w</b>, and <b>-x</b> options do not
274  matched against the final component of the file name (not the entire path). If  apply to this pattern. The option may be given any number of times in order to
275  a file name matches both <b>--include</b> and <b>--exclude</b>, it is excluded.  specify multiple patterns. If a file name matches both an <b>--include</b>
276  There is no short form for this option.  and an <b>--exclude</b> pattern, it is excluded. There is no short form for this
277    option.
278    </P>
279    <P>
280    <b>--exclude-from=</b><i>filename</i>
281    Treat each non-empty line of the file as the data for an <b>--exclude</b>
282    option. What constitutes a newline when reading the file is the operating
283    system's default. The <b>--newline</b> option has no effect on this option. This
284    option may be given more than once in order to specify a number of files to
285    read.
286  </P>  </P>
287  <P>  <P>
288  <b>--exclude-dir</b>=<i>pattern</i>  <b>--exclude-dir</b>=<i>pattern</i>
289  When <b>pcregrep</b> is searching the contents of a directory as a consequence  Directories whose names match the pattern are skipped without being processed,
290  of the <b>-r</b> (recursive search) option, any subdirectories whose names match  whatever the setting of the <b>--recursive</b> option. This applies to all
291  the pattern are excluded. (Note that the \fP--exclude\fP option does not affect  directories, whether listed on the command line, obtained from
292  subdirectories.) The pattern is a PCRE regular expression, and is matched  <b>--file-list</b>, or by scanning a parent directory. The pattern is a PCRE
293  against the final component of the name (not the entire path). If a  regular expression, and is matched against the final component of the directory
294  subdirectory name matches both <b>--include-dir</b> and <b>--exclude-dir</b>, it  name, not the entire path. The <b>-F</b>, <b>-w</b>, and <b>-x</b> options do not
295  is excluded. There is no short form for this option.  apply to this pattern. The option may be given any number of times in order to
296    specify more than one pattern. If a directory matches both <b>--include-dir</b>
297    and <b>--exclude-dir</b>, it is excluded. There is no short form for this
298    option.
299  </P>  </P>
300  <P>  <P>
301  <b>-F</b>, <b>--fixed-strings</b>  <b>-F</b>, <b>--fixed-strings</b>
302  Interpret each pattern as a list of fixed strings, separated by newlines,  Interpret each data-matching pattern as a list of fixed strings, separated by
303  instead of as a regular expression. The <b>-w</b> (match as a word) and <b>-x</b>  newlines, instead of as a regular expression. What constitutes a newline for
304  (match whole line) options can be used with <b>-F</b>. They apply to each of the  this purpose is controlled by the <b>--newline</b> option. The <b>-w</b> (match
305  fixed strings. A line is selected if any of the fixed strings are found in it  as a word) and <b>-x</b> (match whole line) options can be used with <b>-F</b>.
306  (subject to <b>-w</b> or <b>-x</b>, if present).  They apply to each of the fixed strings. A line is selected if any of the fixed
307    strings are found in it (subject to <b>-w</b> or <b>-x</b>, if present). This
308    option applies only to the patterns that are matched against the contents of
309    files; it does not apply to patterns specified by any of the <b>--include</b> or
310    <b>--exclude</b> options.
311  </P>  </P>
312  <P>  <P>
313  <b>-f</b> <i>filename</i>, <b>--file=</b><i>filename</i>  <b>-f</b> <i>filename</i>, <b>--file=</b><i>filename</i>
314  Read a number of patterns from the file, one per line, and match them against  Read patterns from the file, one per line, and match them against
315  each line of input. A data line is output if any of the patterns match it. The  each line of input. What constitutes a newline when reading the file is the
316  filename can be given as "-" to refer to the standard input. When <b>-f</b> is  operating system's default. The <b>--newline</b> option has no effect on this
317  used, patterns specified on the command line using <b>-e</b> may also be  option. Trailing white space is removed from each line, and blank lines are
318  present; they are tested before the file's patterns. However, no other pattern  ignored. An empty file contains no patterns and therefore matches nothing. See
319  is taken from the command line; all arguments are treated as the names of paths  also the comments about multiple patterns versus a single pattern with
320  to be searched. There is an overall maximum of 100 patterns. Trailing white  alternatives in the description of <b>-e</b> above.
321  space is removed from each line, and blank lines are ignored. An empty file  <br>
322  contains no patterns and therefore matches nothing. See also the comments about  <br>
323  multiple patterns versus a single pattern with alternatives in the description  If this option is given more than once, all the specified files are
324  of <b>-e</b> above.  read. A data line is output if any of the patterns match it. A filename can
325    be given as "-" to refer to the standard input. When <b>-f</b> is used, patterns
326    specified on the command line using <b>-e</b> may also be present; they are
327    tested before the file's patterns. However, no other pattern is taken from the
328    command line; all arguments are treated as the names of paths to be searched.
329  </P>  </P>
330  <P>  <P>
331  <b>--file-list</b>=<i>filename</i>  <b>--file-list</b>=<i>filename</i>
332  Read a list of files to be searched from the given file, one per line. Trailing  Read a list of files and/or directories that are to be scanned from the given
333  white space is removed from each line, and blank lines are ignored. These files  file, one per line. Trailing white space is removed from each line, and blank
334  are searched before any others that may be listed on the command line. The  lines are ignored. These paths are processed before any that are listed on the
335  filename can be given as "-" to refer to the standard input. If <b>--file</b>  command line. The filename can be given as "-" to refer to the standard input.
336  and <b>--file-list</b> are both specified as "-", patterns are read first. This  If <b>--file</b> and <b>--file-list</b> are both specified as "-", patterns are
337  is useful only when the standard input is a terminal, from which further lines  read first. This is useful only when the standard input is a terminal, from
338  (the list of files) can be read after an end-of-file indication.  which further lines (the list of files) can be read after an end-of-file
339    indication. If this option is given more than once, all the specified files are
340    read.
341  </P>  </P>
342  <P>  <P>
343  <b>--file-offsets</b>  <b>--file-offsets</b>
# Line 338  If a line number is also being output, i Line 366  If a line number is also being output, i
366  <P>  <P>
367  <b>--help</b>  <b>--help</b>
368  Output a help message, giving brief details of the command options and file  Output a help message, giving brief details of the command options and file
369  type support, and then exit.  type support, and then exit. Anything else on the command line is
370    ignored.
371  </P>  </P>
372  <P>  <P>
373  <b>-I</b>  <b>-I</b>
# Line 351  Ignore upper/lower case distinctions dur Line 380  Ignore upper/lower case distinctions dur
380  </P>  </P>
381  <P>  <P>
382  <b>--include</b>=<i>pattern</i>  <b>--include</b>=<i>pattern</i>
383  When <b>pcregrep</b> is searching the files in a directory as a consequence of  If any <b>--include</b> patterns are specified, the only files that are
384  the <b>-r</b> (recursive search) option, only those regular files whose names  processed are those that match one of the patterns (and do not match an
385  match the pattern are included. Subdirectories are always included and searched  <b>--exclude</b> pattern). This option does not affect directories, but it
386  recursively, subject to the \fP--include-dir\fP and <b>--exclude-dir</b>  applies to all files, whether listed on the command line, obtained from
387  options. The pattern is a PCRE regular expression, and is matched against the  <b>--file-list</b>, or by scanning a directory. The pattern is a PCRE regular
388  final component of the file name (not the entire path). If a file name matches  expression, and is matched against the final component of the file name, not
389  both <b>--include</b> and <b>--exclude</b>, it is excluded. There is no short  the entire path. The <b>-F</b>, <b>-w</b>, and <b>-x</b> options do not apply to
390  form for this option.  this pattern. The option may be given any number of times. If a file name
391    matches both an <b>--include</b> and an <b>--exclude</b> pattern, it is excluded.
392    There is no short form for this option.
393    </P>
394    <P>
395    <b>--include-from=</b><i>filename</i>
396    Treat each non-empty line of the file as the data for an <b>--include</b>
397    option. What constitutes a newline for this purpose is the operating system's
398    default. The <b>--newline</b> option has no effect on this option. This option
399    may be given any number of times; all the files are read.
400  </P>  </P>
401  <P>  <P>
402  <b>--include-dir</b>=<i>pattern</i>  <b>--include-dir</b>=<i>pattern</i>
403  When <b>pcregrep</b> is searching the contents of a directory as a consequence  If any <b>--include-dir</b> patterns are specified, the only directories that
404  of the <b>-r</b> (recursive search) option, only those subdirectories whose  are processed are those that match one of the patterns (and do not match an
405  names match the pattern are included. (Note that the <b>--include</b> option  <b>--exclude-dir</b> pattern). This applies to all directories, whether listed
406  does not affect subdirectories.) The pattern is a PCRE regular expression, and  on the command line, obtained from <b>--file-list</b>, or by scanning a parent
407  is matched against the final component of the name (not the entire path). If a  directory. The pattern is a PCRE regular expression, and is matched against the
408  subdirectory name matches both <b>--include-dir</b> and <b>--exclude-dir</b>, it  final component of the directory name, not the entire path. The <b>-F</b>,
409  is excluded. There is no short form for this option.  <b>-w</b>, and <b>-x</b> options do not apply to this pattern. The option may be
410    given any number of times. If a directory matches both <b>--include-dir</b> and
411    <b>--exclude-dir</b>, it is excluded. There is no short form for this option.
412  </P>  </P>
413  <P>  <P>
414  <b>-L</b>, <b>--files-without-match</b>  <b>-L</b>, <b>--files-without-match</b>
# Line 397  short form for this option. Line 437  short form for this option.
437  When this option is given, input is read and processed line by line, and the  When this option is given, input is read and processed line by line, and the
438  output is flushed after each write. By default, input is read in large chunks,  output is flushed after each write. By default, input is read in large chunks,
439  unless <b>pcregrep</b> can determine that it is reading from a terminal (which  unless <b>pcregrep</b> can determine that it is reading from a terminal (which
440  is currently possible only in Unix environments). Output to terminal is  is currently possible only in Unix-like environments). Output to terminal is
441  normally automatically flushed by the operating system. This option can be  normally automatically flushed by the operating system. This option can be
442  useful when the input or output is attached to a pipe and you do not want  useful when the input or output is attached to a pipe and you do not want
443  <b>pcregrep</b> to buffer up large amounts of data. However, its use will affect  <b>pcregrep</b> to buffer up large amounts of data. However, its use will affect
# Line 484  When the PCRE library is built, a defaul Line 524  When the PCRE library is built, a defaul
524  This is normally the standard sequence for the operating system. Unless  This is normally the standard sequence for the operating system. Unless
525  otherwise specified by this option, <b>pcregrep</b> uses the library's default.  otherwise specified by this option, <b>pcregrep</b> uses the library's default.
526  The possible values for this option are CR, LF, CRLF, ANYCRLF, or ANY. This  The possible values for this option are CR, LF, CRLF, ANYCRLF, or ANY. This
527  makes it possible to use <b>pcregrep</b> on files that have come from other  makes it possible to use <b>pcregrep</b> to scan files that have come from other
528  environments without having to modify their line endings. If the data that is  environments without having to modify their line endings. If the data that is
529  being scanned does not agree with the convention set by this option,  being scanned does not agree with the convention set by this option,
530  <b>pcregrep</b> may behave in strange ways.  <b>pcregrep</b> may behave in strange ways. Note that this option does not
531    apply to files specified by the <b>-f</b>, <b>--exclude-from</b>, or
532    <b>--include-from</b> options, which are expected to use the operating system's
533    standard newline sequence.
534  </P>  </P>
535  <P>  <P>
536  <b>-n</b>, <b>--line-number</b>  <b>-n</b>, <b>--line-number</b>
# Line 519  exclusive with <b>--file-offsets</b> and Line 562  exclusive with <b>--file-offsets</b> and
562  <P>  <P>
563  <b>-o</b><i>number</i>, <b>--only-matching</b>=<i>number</i>  <b>-o</b><i>number</i>, <b>--only-matching</b>=<i>number</i>
564  Show only the part of the line that matched the capturing parentheses of the  Show only the part of the line that matched the capturing parentheses of the
565  given number. Up to 32 capturing parentheses are supported. Because these  given number. Up to 32 capturing parentheses are supported, and -o0 is
566  options can be given without an argument (see above), if an argument is  equivalent to <b>-o</b> without a number. Because these options can be given
567  present, it must be given in the same shell item, for example, -o3 or  without an argument (see above), if an argument is present, it must be given in
568  --only-matching=2. The comments given for the non-argument case above also  the same shell item, for example, -o3 or --only-matching=2. The comments given
569  apply to this case. If the specified capturing parentheses do not exist in the  for the non-argument case above also apply to this case. If the specified
570  pattern, or were not set in the match, nothing is output unless the file name  capturing parentheses do not exist in the pattern, or were not set in the
571  or line number are being printed.  match, nothing is output unless the file name or line number are being printed.
572    <br>
573    <br>
574    If this option is given multiple times, multiple substrings are output, in the
575    order the options are given. For example, -o3 -o1 -o3 causes the substrings
576    matched by capturing parentheses 3 and 1 and then 3 again to be output. By
577    default, there is no separator (but see the next option).
578    </P>
579    <P>
580    <b>--om-separator</b>=<i>text</i>
581    Specify a separating string for multiple occurrences of <b>-o</b>. The default
582    is an empty string. Separating strings are never coloured.
583  </P>  </P>
584  <P>  <P>
585  <b>-q</b>, <b>--quiet</b>  <b>-q</b>, <b>--quiet</b>
# Line 553  found in other files. Line 607  found in other files.
607  <P>  <P>
608  <b>-u</b>, <b>--utf-8</b>  <b>-u</b>, <b>--utf-8</b>
609  Operate in UTF-8 mode. This option is available only if PCRE has been compiled  Operate in UTF-8 mode. This option is available only if PCRE has been compiled
610  with UTF-8 support. Both patterns and subject lines must be valid strings of  with UTF-8 support. All patterns (including those for any <b>--exclude</b> and
611  UTF-8 characters.  <b>--include</b> options) and all subject lines that are scanned must be valid
612    strings of UTF-8 characters.
613  </P>  </P>
614  <P>  <P>
615  <b>-V</b>, <b>--version</b>  <b>-V</b>, <b>--version</b>
616  Write the version numbers of <b>pcregrep</b> and the PCRE library that is being  Write the version numbers of <b>pcregrep</b> and the PCRE library to the
617  used to the standard error stream.  standard output and then exit. Anything else on the command line is
618    ignored.
619  </P>  </P>
620  <P>  <P>
621  <b>-v</b>, <b>--invert-match</b>  <b>-v</b>, <b>--invert-match</b>
# Line 569  the patterns are the ones that are found Line 625  the patterns are the ones that are found
625  <P>  <P>
626  <b>-w</b>, <b>--word-regex</b>, <b>--word-regexp</b>  <b>-w</b>, <b>--word-regex</b>, <b>--word-regexp</b>
627  Force the patterns to match only whole words. This is equivalent to having \b  Force the patterns to match only whole words. This is equivalent to having \b
628  at the start and end of the pattern.  at the start and end of the pattern. This option applies only to the patterns
629    that are matched against the contents of files; it does not apply to patterns
630    specified by any of the <b>--include</b> or <b>--exclude</b> options.
631  </P>  </P>
632  <P>  <P>
633  <b>-x</b>, <b>--line-regex</b>, <b>--line-regexp</b>  <b>-x</b>, <b>--line-regex</b>, <b>--line-regexp</b>
634  Force the patterns to be anchored (each must start matching at the beginning of  Force the patterns to be anchored (each must start matching at the beginning of
635  a line) and in addition, require them to match entire lines. This is  a line) and in addition, require them to match entire lines. This is equivalent
636  equivalent to having ^ and $ characters at the start and end of each  to having ^ and $ characters at the start and end of each alternative branch in
637  alternative branch in every pattern.  every pattern. This option applies only to the patterns that are matched
638    against the contents of files; it does not apply to patterns specified by any
639    of the <b>--include</b> or <b>--exclude</b> options.
640  </P>  </P>
641  <br><a name="SEC6" href="#TOC1">ENVIRONMENT VARIABLES</a><br>  <br><a name="SEC6" href="#TOC1">ENVIRONMENT VARIABLES</a><br>
642  <P>  <P>
# Line 588  by the <b>--locale</b> option. If no loc Line 648  by the <b>--locale</b> option. If no loc
648  <br><a name="SEC7" href="#TOC1">NEWLINES</a><br>  <br><a name="SEC7" href="#TOC1">NEWLINES</a><br>
649  <P>  <P>
650  The <b>-N</b> (<b>--newline</b>) option allows <b>pcregrep</b> to scan files with  The <b>-N</b> (<b>--newline</b>) option allows <b>pcregrep</b> to scan files with
651  different newline conventions from the default. However, the setting of this  different newline conventions from the default. Any parts of the input files
652  option does not affect the way in which <b>pcregrep</b> writes information to  that are written to the standard output are copied identically, with whatever
653  the standard error and output streams. It uses the string "\n" in C  newline sequences they have in the input. However, the setting of this option
654  <b>printf()</b> calls to indicate newlines, relying on the C I/O library to  does not affect the interpretation of files specified by the <b>-f</b>,
655  convert this to an appropriate sequence if the output is sent to a file.  <b>--exclude-from</b>, or <b>--include-from</b> options, which are assumed to use
656    the operating system's standard newline sequence, nor does it affect the way in
657    which <b>pcregrep</b> writes informational messages to the standard error and
658    output streams. For these it uses the string "\n" to indicate newlines,
659    relying on the C I/O library to convert this to an appropriate sequence.
660  </P>  </P>
661  <br><a name="SEC8" href="#TOC1">OPTIONS COMPATIBILITY</a><br>  <br><a name="SEC8" href="#TOC1">OPTIONS COMPATIBILITY</a><br>
662  <P>  <P>
# Line 601  as in the GNU <b>grep</b> program. Any l Line 665  as in the GNU <b>grep</b> program. Any l
665  <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>
666  (PCRE terminology). However, the <b>--file-list</b>, <b>--file-offsets</b>,  (PCRE terminology). However, the <b>--file-list</b>, <b>--file-offsets</b>,
667  <b>--include-dir</b>, <b>--line-offsets</b>, <b>--locale</b>, <b>--match-limit</b>,  <b>--include-dir</b>, <b>--line-offsets</b>, <b>--locale</b>, <b>--match-limit</b>,
668  <b>-M</b>, <b>--multiline</b>, <b>-N</b>, <b>--newline</b>,  <b>-M</b>, <b>--multiline</b>, <b>-N</b>, <b>--newline</b>, <b>--om-separator</b>,
669  <b>--recursion-limit</b>, <b>-u</b>, and <b>--utf-8</b> options are specific to  <b>--recursion-limit</b>, <b>-u</b>, and <b>--utf-8</b> options are specific to
670  <b>pcregrep</b>, as is the use of the <b>--only-matching</b> option with a  <b>pcregrep</b>, as is the use of the <b>--only-matching</b> option with a
671  capturing parentheses number.  capturing parentheses number.
# Line 671  affect the return code. Line 735  affect the return code.
735  </P>  </P>
736  <br><a name="SEC12" href="#TOC1">SEE ALSO</a><br>  <br><a name="SEC12" href="#TOC1">SEE ALSO</a><br>
737  <P>  <P>
738  <b>pcrepattern</b>(3), <b>pcretest</b>(1).  <b>pcrepattern</b>(3), <b>pcresyntax</b>(3), <b>pcretest</b>(1).
739  </P>  </P>
740  <br><a name="SEC13" href="#TOC1">AUTHOR</a><br>  <br><a name="SEC13" href="#TOC1">AUTHOR</a><br>
741  <P>  <P>
# Line 684  Cambridge CB2 3QH, England. Line 748  Cambridge CB2 3QH, England.
748  </P>  </P>
749  <br><a name="SEC14" href="#TOC1">REVISION</a><br>  <br><a name="SEC14" href="#TOC1">REVISION</a><br>
750  <P>  <P>
751  Last updated: 04 March 2012  Last updated: 13 September 2012
752  <br>  <br>
753  Copyright &copy; 1997-2012 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
754  <br>  <br>

Legend:
Removed from v.1193  
changed lines
  Added in v.1194

  ViewVC Help
Powered by ViewVC 1.1.5