/[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 392 by ph10, Tue Mar 17 21:30:30 2009 UTC revision 535 by ph10, Thu Jun 3 19:18:24 2010 UTC
# Line 67  which multiple patterns are specified ca Line 67  which multiple patterns are specified ca
67  above options is used.  above options is used.
68  .P  .P
69  Patterns that can match an empty string are accepted, but empty string  Patterns that can match an empty string are accepted, but empty string
70  matches are not recognized. An example is the pattern "(super)?(man)?", in  matches are never recognized. An example is the pattern "(super)?(man)?", in
71  which all components are optional. This pattern finds all occurrences of both  which all components are optional. This pattern finds all occurrences of both
72  "super" and "man"; the output differs from matching with "super|man" when only  "super" and "man"; the output differs from matching with "super|man" when only
73  the matching substrings are being shown.  the matching substrings are being shown.
# Line 88  standard input is always so treated. Line 88  standard input is always so treated.
88  .  .
89  .SH OPTIONS  .SH OPTIONS
90  .rs  .rs
91    .sp
92    The order in which some of the options appear can affect the output. For
93    example, both the \fB-h\fP and \fB-l\fP options affect the printing of file
94    names. Whichever comes later in the command line will be the one that takes
95    effect.
96  .TP 10  .TP 10
97  \fB--\fP  \fB--\fP
98  This terminate the list of options. It is useful if the next item on the  This terminate the list of options. It is useful if the next item on the
# Line 115  Output \fInumber\fP lines of context bot Line 120  Output \fInumber\fP lines of context bot
120  This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.  This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.
121  .TP  .TP
122  \fB-c\fP, \fB--count\fP  \fB-c\fP, \fB--count\fP
123  Do not output individual lines; instead just output a count of the number of  Do not output individual lines from the files that are being scanned; instead
124  lines that would otherwise have been output. If several files are given, a  output the number of lines that would otherwise have been shown. If no lines
125  count is output for each of them. In this mode, the \fB-A\fP, \fB-B\fP, and  are selected, the number zero is output. If several files are are being
126  \fB-C\fP options are ignored.  scanned, a count is output for each of them. However, if the
127    \fB--files-with-matches\fP option is also used, only those files whose counts
128    are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP,
129    \fB-B\fP, and \fB-C\fP options are ignored.
130  .TP  .TP
131  \fB--colour\fP, \fB--color\fP  \fB--colour\fP, \fB--color\fP
132  If this option is given without any data, it is equivalent to "--colour=auto".  If this option is given without any data, it is equivalent to "--colour=auto".
# Line 133  coloured. The value (which is optional, Line 141  coloured. The value (which is optional,
141  connected to a terminal. More resources are used when colouring is enabled,  connected to a terminal. More resources are used when colouring is enabled,
142  because \fBpcregrep\fP has to search for all possible matches in a line, not  because \fBpcregrep\fP has to search for all possible matches in a line, not
143  just one, in order to colour them all.  just one, in order to colour them all.
144    .sp
145  The colour that is used can be specified by setting the environment variable  The colour that is used can be specified by setting the environment variable
146  PCREGREP_COLOUR or PCREGREP_COLOR. The value of this variable should be a  PCREGREP_COLOUR or PCREGREP_COLOR. The value of this variable should be a
147  string of two numbers, separated by a semicolon. They are copied directly into  string of two numbers, separated by a semicolon. They are copied directly into
# Line 263  output once, on a separate line. Line 271  output once, on a separate line.
271  \fB-l\fP, \fB--files-with-matches\fP  \fB-l\fP, \fB--files-with-matches\fP
272  Instead of outputting lines from the files, just output the names of the files  Instead of outputting lines from the files, just output the names of the files
273  containing lines that would have been output. Each file name is output  containing lines that would have been output. Each file name is output
274  once, on a separate line. Searching stops as soon as a matching line is found  once, on a separate line. Searching normally stops as soon as a matching line
275  in a file.  is found in a file. However, if the \fB-c\fP (count) option is also used,
276    matching continues in order to obtain the correct count, and those files that
277    have at least one match are listed along with their counts. Using this option
278    with \fB-c\fP is a way of suppressing the listing of files with no matches.
279  .TP  .TP
280  \fB--label\fP=\fIname\fP  \fB--label\fP=\fIname\fP
281  This option supplies a name to be used for the standard input when file names  This option supplies a name to be used for the standard input when file names
282  are being output. If not supplied, "(standard input)" is used. There is no  are being output. If not supplied, "(standard input)" is used. There is no
283  short form for this option.  short form for this option.
284  .TP  .TP
285    \fB--line-buffered\fP
286    When this option is given, input is read and processed line by line, and the
287    output is flushed after each write. By default, input is read in large chunks,
288    unless \fBpcregrep\fP can determine that it is reading from a terminal (which
289    is currently possible only in Unix environments). Output to terminal is
290    normally automatically flushed by the operating system. This option can be
291    useful when the input or output is attached to a pipe and you do not want
292    \fBpcregrep\fP to buffer up large amounts of data. However, its use will affect
293    performance, and the \fB-M\fP (multiline) option ceases to work.
294    .TP
295  \fB--line-offsets\fP  \fB--line-offsets\fP
296  Instead of showing lines or parts of lines that match, show each match as a  Instead of showing lines or parts of lines that match, show each match as a
297  line number, the offset from the start of the line, and a length. The line  line number, the offset from the start of the line, and a length. The line
# Line 296  that \fBpcregrep\fP buffers the input fi Line 317  that \fBpcregrep\fP buffers the input fi
317  \fBpcregrep\fP ensures that at least 8K characters or the rest of the document  \fBpcregrep\fP ensures that at least 8K characters or the rest of the document
318  (whichever is the shorter) are available for forward matching, and similarly  (whichever is the shorter) are available for forward matching, and similarly
319  the previous 8K characters (or all the previous characters, if fewer than 8K)  the previous 8K characters (or all the previous characters, if fewer than 8K)
320  are guaranteed to be available for lookbehind assertions.  are guaranteed to be available for lookbehind assertions. This option does not
321    work when input is read line by line (see \fP--line-buffered\fP.)
322  .TP  .TP
323  \fB-N\fP \fInewline-type\fP, \fB--newline=\fP\fInewline-type\fP  \fB-N\fP \fInewline-type\fP, \fB--newline=\fP\fInewline-type\fP
324  The PCRE library supports five different conventions for indicating  The PCRE library supports five different conventions for indicating
# Line 399  The majority of short and long forms of Line 421  The majority of short and long forms of
421  as in the GNU \fBgrep\fP program. Any long option of the form  as in the GNU \fBgrep\fP program. Any long option of the form
422  \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
423  (PCRE terminology). However, the \fB--locale\fP, \fB-M\fP, \fB--multiline\fP,  (PCRE terminology). However, the \fB--locale\fP, \fB-M\fP, \fB--multiline\fP,
424  \fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP.  \fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP. If both the
425    \fB-c\fP and \fB-l\fP options are given, GNU grep lists only file names,
426    without counts, but \fBpcregrep\fP gives the counts.
427  .  .
428  .  .
429  .SH "OPTIONS WITH DATA"  .SH "OPTIONS WITH DATA"
# Line 472  Cambridge CB2 3QH, England. Line 496  Cambridge CB2 3QH, England.
496  .rs  .rs
497  .sp  .sp
498  .nf  .nf
499  Last updated: 01 March 2009  Last updated: 21 May 2010
500  Copyright (c) 1997-2009 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
501  .fi  .fi

Legend:
Removed from v.392  
changed lines
  Added in v.535

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12