43 |
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 |
44 |
start of each line. However, there are options that can change how |
start of each line. However, there are options that can change how |
45 |
\fBpcregrep\fP behaves. In particular, the \fB-M\fP option makes it possible to |
\fBpcregrep\fP behaves. In particular, the \fB-M\fP option makes it possible to |
46 |
search for patterns that span line boundaries. |
search for patterns that span line boundaries. What defines a line boundary is |
47 |
|
controlled by the \fB-N\fP (\fB--newline\fP) option. |
48 |
.P |
.P |
49 |
Patterns are limited to 8K or BUFSIZ characters, whichever is the greater. |
Patterns are limited to 8K or BUFSIZ characters, whichever is the greater. |
50 |
BUFSIZ is defined in \fB<stdio.h>\fP. |
BUFSIZ is defined in \fB<stdio.h>\fP. |
219 |
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) |
220 |
are guaranteed to be available for lookbehind assertions. |
are guaranteed to be available for lookbehind assertions. |
221 |
.TP |
.TP |
222 |
|
\fB-N\fP \fInewline-type\fP, \fB--newline=\fP\fInewline-type\fP |
223 |
|
The PCRE library supports three different character sequences for indicating |
224 |
|
the ends of lines. They are the single-character sequences CR (carriage return) |
225 |
|
and LF (linefeed), and the two-character sequence CR, LF. When the library is |
226 |
|
built, a default line-ending sequence is specified. This is normally the |
227 |
|
standard sequence for the operating system. Unless otherwise specified by this |
228 |
|
option, \fBpcregrep\fP uses the default. The possible values for this option |
229 |
|
are CR, LF, or CRLF. This makes it possible to use \fBpcregrep\fP on files that |
230 |
|
have come from other environments without having to modify their line endings. |
231 |
|
If the data that is being scanned does not agree with the convention set by |
232 |
|
this option, \fBpcregrep\fP may behave in strange ways. |
233 |
|
.TP |
234 |
\fB-n\fP, \fB--line-number\fP |
\fB-n\fP, \fB--line-number\fP |
235 |
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 |
236 |
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 |
290 |
(usually the "C" locale) is used. |
(usually the "C" locale) is used. |
291 |
. |
. |
292 |
. |
. |
293 |
|
.SH "NEWLINES" |
294 |
|
.rs |
295 |
|
.sp |
296 |
|
The \fB-N\fP (\fB--newline\fP) option allows \fBpcregrep\fP to scan files with |
297 |
|
different newline conventions from the default. However, the setting of this |
298 |
|
option does not affect the way in which \fBpcregrep\fP writes information to |
299 |
|
the standard error and output streams. It uses the string "\en" in C |
300 |
|
\fBprintf()\fP calls to indicate newlines, relying on the C I/O library to |
301 |
|
convert this to an appropriate sequence if the output is sent to a file. |
302 |
|
. |
303 |
|
. |
304 |
.SH "OPTIONS COMPATIBILITY" |
.SH "OPTIONS COMPATIBILITY" |
305 |
.rs |
.rs |
306 |
.sp |
.sp |
371 |
Cambridge CB2 3QG, England. |
Cambridge CB2 3QG, England. |
372 |
.P |
.P |
373 |
.in 0 |
.in 0 |
374 |
Last updated: 23 January 2006 |
Last updated: 06 June 2006 |
375 |
.br |
.br |
376 |
Copyright (c) 1997-2006 University of Cambridge. |
Copyright (c) 1997-2006 University of Cambridge. |