~ubuntu-branches/ubuntu/trusty/pcre3/trusty

« back to all changes in this revision

Viewing changes to .pc/pcregrep.1-patch/doc/pcregrep.1

  • Committer: Package Import Robot
  • Author(s): Mark Baker
  • Date: 2012-09-13 19:58:45 UTC
  • mfrom: (23.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120913195845-wd12z63sm0b07n59
Tags: 1:8.31-1
* New upstream release
* Applied patch from upstream bugzilla #1287 to fix bug where wrong
  value is in re_nsub in some cases (Closes: #686495)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH PCREGREP 1
 
1
.TH PCREGREP 1 "04 March 2012" "PCRE 8.31"
2
2
.SH NAME
3
3
pcregrep - a grep with Perl-compatible regular expressions.
4
4
.SH SYNOPSIS
95
95
standard input is always so treated.
96
96
.
97
97
.
 
98
.SH "BINARY FILES"
 
99
.rs
 
100
.sp
 
101
By default, a file that contains a binary zero byte within the first 1024 bytes
 
102
is identified as a binary file, and is processed specially. (GNU grep also
 
103
identifies binary files in this manner.) See the \fB--binary-files\fP option
 
104
for a means of changing the way binary files are handled.
 
105
.
 
106
.
98
107
.SH OPTIONS
99
108
.rs
100
109
.sp
117
126
of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP
118
127
guarantees to have up to 8K of following text available for context output.
119
128
.TP
 
129
\fB-a\fP, \fB--text\fP
 
130
Treat binary files as text. This is equivalent to
 
131
\fB--binary-files\fP=\fItext\fP.
 
132
.TP
120
133
\fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP
121
134
Output \fInumber\fP lines of context before each matching line. If filenames
122
135
and/or line numbers are being output, a hyphen separator is used instead of a
125
138
of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP
126
139
guarantees to have up to 8K of preceding text available for context output.
127
140
.TP
 
141
\fB--binary-files=\fP\fIword\fP
 
142
Specify how binary files are to be processed. If the word is "binary" (the
 
143
default), pattern matching is performed on binary files, but the only output is
 
144
"Binary file <name> matches" when a match succeeds. If the word is "text",
 
145
which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are
 
146
processed in the same way as any other file. In this case, when a match
 
147
succeeds, the output may be binary garbage, which can have nasty effects if
 
148
sent to a terminal. If the word is "without-match", which is equivalent to the
 
149
\fB-I\fP option, binary files are not processed at all; they are assumed not to
 
150
be of interest.
 
151
.TP
128
152
\fB--buffer-size=\fP\fInumber\fP
129
153
Set the parameter that controls how much memory is used for buffering files
130
154
that are being scanned.
224
248
filename can be given as "-" to refer to the standard input. When \fB-f\fP is
225
249
used, patterns specified on the command line using \fB-e\fP may also be
226
250
present; they are tested before the file's patterns. However, no other pattern
227
 
is taken from the command line; all arguments are treated as file names. There
228
 
is an overall maximum of 100 patterns. Trailing white space is removed from
229
 
each line, and blank lines are ignored. An empty file contains no patterns and
230
 
therefore matches nothing. See also the comments about multiple patterns versus
231
 
a single pattern with alternatives in the description of \fB-e\fP above.
 
251
is taken from the command line; all arguments are treated as the names of paths
 
252
to be searched. There is an overall maximum of 100 patterns. Trailing white
 
253
space is removed from each line, and blank lines are ignored. An empty file
 
254
contains no patterns and therefore matches nothing. See also the comments about
 
255
multiple patterns versus a single pattern with alternatives in the description
 
256
of \fB-e\fP above.
 
257
.TP
 
258
\fB--file-list\fP=\fIfilename\fP
 
259
Read a list of files to be searched from the given file, one per line. Trailing
 
260
white space is removed from each line, and blank lines are ignored. These files
 
261
are searched before any others that may be listed on the command line. The
 
262
filename can be given as "-" to refer to the standard input. If \fB--file\fP
 
263
and \fB--file-list\fP are both specified as "-", patterns are read first. This
 
264
is useful only when the standard input is a terminal, from which further lines
 
265
(the list of files) can be read after an end-of-file indication.
232
266
.TP
233
267
\fB--file-offsets\fP
234
268
Instead of showing lines or parts of lines that match, show each match as an
255
289
Output a help message, giving brief details of the command options and file
256
290
type support, and then exit.
257
291
.TP
 
292
\fB-I\fP
 
293
Treat binary files as never matching. This is equivalent to
 
294
\fB--binary-files\fP=\fIwithout-match\fP.
 
295
.TP
258
296
\fB-i\fP, \fB--ignore-case\fP
259
297
Ignore upper/lower case distinctions during comparisons.
260
298
.TP
483
521
.rs
484
522
.sp
485
523
Many of the short and long forms of \fBpcregrep\fP's options are the same
486
 
as in the GNU \fBgrep\fP program (version 2.5.4). Any long option of the form
 
524
as in the GNU \fBgrep\fP program. Any long option of the form
487
525
\fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
488
 
(PCRE terminology). However, the \fB--file-offsets\fP, \fB--include-dir\fP,
489
 
\fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, \fB-M\fP,
490
 
\fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--recursion-limit\fP,
491
 
\fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP, as is the
492
 
use of the \fB--only-matching\fP option with a capturing parentheses number.
 
526
(PCRE terminology). However, the \fB--file-list\fP, \fB--file-offsets\fP,
 
527
\fB--include-dir\fP, \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP,
 
528
\fB-M\fP, \fB--multiline\fP, \fB-N\fP, \fB--newline\fP,
 
529
\fB--recursion-limit\fP, \fB-u\fP, and \fB--utf-8\fP options are specific to
 
530
\fBpcregrep\fP, as is the use of the \fB--only-matching\fP option with a
 
531
capturing parentheses number.
493
532
.P
494
533
Although most of the common options work the same way, a few are different in
495
534
\fBpcregrep\fP. For example, the \fB--include\fP option's argument is a glob
577
616
.rs
578
617
.sp
579
618
.nf
580
 
Last updated: 06 September 2011
581
 
Copyright (c) 1997-2011 University of Cambridge.
 
619
Last updated: 04 March 2012
 
620
Copyright (c) 1997-2012 University of Cambridge.
582
621
.fi