11 |
grep commands do, but it uses the PCRE regular expression library to support |
grep commands do, but it uses the PCRE regular expression library to support |
12 |
patterns that are compatible with the regular expressions of Perl 5. See |
patterns that are compatible with the regular expressions of Perl 5. See |
13 |
.\" HREF |
.\" HREF |
14 |
\fBpcrepattern\fP |
\fBpcrepattern\fP(3) |
15 |
.\" |
.\" |
16 |
for a full description of syntax and semantics of the regular expressions that |
for a full description of syntax and semantics of the regular expressions |
17 |
PCRE supports. |
that PCRE supports. |
18 |
.P |
.P |
19 |
Patterns, whether supplied on the command line or in a separate file, are given |
Patterns, whether supplied on the command line or in a separate file, are given |
20 |
without delimiters. For example: |
without delimiters. For example: |
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 |
\fB-N\fP \fInewline-type\fP, \fB--newline=\fP\fInewline-type\fP |
223 |
The PCRE library supports three different character sequences for indicating |
The PCRE library supports five different conventions for indicating |
224 |
the ends of lines. They are the single-character sequences CR (carriage return) |
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 |
and LF (linefeed), the two-character sequence CRLF, an "anycrlf" convention, |
226 |
built, a default line-ending sequence is specified. This is normally the |
which recognizes any of the preceding three types, and an "any" convention, in |
227 |
standard sequence for the operating system. Unless otherwise specified by this |
which any Unicode line ending sequence is assumed to end a line. The Unicode |
228 |
option, \fBpcregrep\fP uses the default. The possible values for this option |
sequences are the three just mentioned, plus VT (vertical tab, U+000B), FF |
229 |
are CR, LF, or CRLF. This makes it possible to use \fBpcregrep\fP on files that |
(formfeed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and |
230 |
have come from other environments without having to modify their line endings. |
PS (paragraph separator, U+2029). |
231 |
If the data that is being scanned does not agree with the convention set by |
.sp |
232 |
this option, \fBpcregrep\fP may behave in strange ways. |
When the PCRE library is built, a default line-ending sequence is specified. |
233 |
|
This is normally the standard sequence for the operating system. Unless |
234 |
|
otherwise specified by this option, \fBpcregrep\fP uses the library's default. |
235 |
|
The possible values for this option are CR, LF, CRLF, ANYCRLF, or ANY. This |
236 |
|
makes it possible to use \fBpcregrep\fP on files that have come from other |
237 |
|
environments without having to modify their line endings. If the data that is |
238 |
|
being scanned does not agree with the convention set by this option, |
239 |
|
\fBpcregrep\fP may behave in strange ways. |
240 |
.TP |
.TP |
241 |
\fB-n\fP, \fB--line-number\fP |
\fB-n\fP, \fB--line-number\fP |
242 |
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 |
281 |
Force the patterns to match only whole words. This is equivalent to having \eb |
Force the patterns to match only whole words. This is equivalent to having \eb |
282 |
at the start and end of the pattern. |
at the start and end of the pattern. |
283 |
.TP |
.TP |
284 |
\fB-x\fP, \fB--line-regex\fP, \fP--line-regexp\fP |
\fB-x\fP, \fB--line-regex\fP, \fB--line-regexp\fP |
285 |
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 |
286 |
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 |
287 |
equivalent to having ^ and $ characters at the start and end of each |
equivalent to having ^ and $ characters at the start and end of each |
346 |
it has no data. |
it has no data. |
347 |
. |
. |
348 |
. |
. |
349 |
.SH MATCHING ERRORS |
.SH "MATCHING ERRORS" |
350 |
.rs |
.rs |
351 |
.sp |
.sp |
352 |
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 |
368 |
code. |
code. |
369 |
. |
. |
370 |
. |
. |
371 |
|
.SH "SEE ALSO" |
372 |
|
.rs |
373 |
|
.sp |
374 |
|
\fBpcrepattern\fP(3), \fBpcretest\fP(1). |
375 |
|
. |
376 |
|
. |
377 |
.SH AUTHOR |
.SH AUTHOR |
378 |
.rs |
.rs |
379 |
.sp |
.sp |
380 |
|
.nf |
381 |
Philip Hazel |
Philip Hazel |
|
.br |
|
382 |
University Computing Service |
University Computing Service |
383 |
.br |
Cambridge CB2 3QH, England. |
384 |
Cambridge CB2 3QG, England. |
.fi |
385 |
.P |
. |
386 |
.in 0 |
. |
387 |
Last updated: 06 June 2006 |
.SH REVISION |
388 |
.br |
.rs |
389 |
Copyright (c) 1997-2006 University of Cambridge. |
.sp |
390 |
|
.nf |
391 |
|
Last updated: 16 April 2007 |
392 |
|
Copyright (c) 1997-2007 University of Cambridge. |
393 |
|
.fi |