| 157 |
The following table shows additional modifiers for setting PCRE options that do |
The following table shows additional modifiers for setting PCRE options that do |
| 158 |
not correspond to anything in Perl: |
not correspond to anything in Perl: |
| 159 |
.sp |
.sp |
| 160 |
\fB/A\fP PCRE_ANCHORED |
\fB/A\fP PCRE_ANCHORED |
| 161 |
\fB/C\fP PCRE_AUTO_CALLOUT |
\fB/C\fP PCRE_AUTO_CALLOUT |
| 162 |
\fB/E\fP PCRE_DOLLAR_ENDONLY |
\fB/E\fP PCRE_DOLLAR_ENDONLY |
| 163 |
\fB/f\fP PCRE_FIRSTLINE |
\fB/f\fP PCRE_FIRSTLINE |
| 164 |
\fB/J\fP PCRE_DUPNAMES |
\fB/J\fP PCRE_DUPNAMES |
| 165 |
\fB/N\fP PCRE_NO_AUTO_CAPTURE |
\fB/N\fP PCRE_NO_AUTO_CAPTURE |
| 166 |
\fB/U\fP PCRE_UNGREEDY |
\fB/U\fP PCRE_UNGREEDY |
| 167 |
\fB/X\fP PCRE_EXTRA |
\fB/X\fP PCRE_EXTRA |
| 168 |
\fB/<cr>\fP PCRE_NEWLINE_CR |
\fB/<cr>\fP PCRE_NEWLINE_CR |
| 169 |
\fB/<lf>\fP PCRE_NEWLINE_LF |
\fB/<lf>\fP PCRE_NEWLINE_LF |
| 170 |
\fB/<crlf>\fP PCRE_NEWLINE_CRLF |
\fB/<crlf>\fP PCRE_NEWLINE_CRLF |
| 171 |
\fB/<anycrlf>\fP PCRE_NEWLINE_ANYCRLF |
\fB/<anycrlf>\fP PCRE_NEWLINE_ANYCRLF |
| 172 |
\fB/<any>\fP PCRE_NEWLINE_ANY |
\fB/<any>\fP PCRE_NEWLINE_ANY |
| 173 |
.sp |
\fB/<bsr_anycrlf>\fP PCRE_BSR_ANYCRLF |
| 174 |
Those specifying line ending sequencess are literal strings as shown. This |
\fB/<bsr_unicode>\fP PCRE_BSR_UNICODE |
| 175 |
example sets multiline matching with CRLF as the line ending sequence: |
.sp |
| 176 |
|
Those specifying line ending sequences are literal strings as shown, but the |
| 177 |
|
letters can be in either case. This example sets multiline matching with CRLF |
| 178 |
|
as the line ending sequence: |
| 179 |
.sp |
.sp |
| 180 |
/^abc/m<crlf> |
/^abc/m<crlf> |
| 181 |
.sp |
.sp |
| 414 |
The use of \ex{hh...} to represent UTF-8 characters is not dependent on the use |
The use of \ex{hh...} to represent UTF-8 characters is not dependent on the use |
| 415 |
of the \fB/8\fP modifier on the pattern. It is recognized always. There may be |
of the \fB/8\fP modifier on the pattern. It is recognized always. There may be |
| 416 |
any number of hexadecimal digits inside the braces. The result is from one to |
any number of hexadecimal digits inside the braces. The result is from one to |
| 417 |
six bytes, encoded according to the UTF-8 rules. |
six bytes, encoded according to the original UTF-8 rules of RFC 2279. This |
| 418 |
|
allows for values in the range 0 to 0x7FFFFFFF. Note that not all of those are |
| 419 |
|
valid Unicode code points, or indeed valid UTF-8 characters according to the |
| 420 |
|
later rules in RFC 3629. |
| 421 |
. |
. |
| 422 |
. |
. |
| 423 |
.SH "THE ALTERNATIVE MATCHING FUNCTION" |
.SH "THE ALTERNATIVE MATCHING FUNCTION" |
| 463 |
data> xyz |
data> xyz |
| 464 |
No match |
No match |
| 465 |
.sp |
.sp |
| 466 |
|
Note that unset capturing substrings that are not followed by one that is set |
| 467 |
|
are not returned by \fBpcre_exec()\fP, and are not shown by \fBpcretest\fP. In |
| 468 |
|
the following example, there are two capturing substrings, but when the first |
| 469 |
|
data line is matched, the second, unset substring is not shown. An "internal" |
| 470 |
|
unset substring is shown as "<unset>", as for the second data line. |
| 471 |
|
.sp |
| 472 |
|
re> /(a)|(b)/ |
| 473 |
|
data> a |
| 474 |
|
0: a |
| 475 |
|
1: a |
| 476 |
|
data> b |
| 477 |
|
0: b |
| 478 |
|
1: <unset> |
| 479 |
|
2: b |
| 480 |
|
.sp |
| 481 |
If the strings contain any non-printing characters, they are output as \e0x |
If the strings contain any non-printing characters, they are output as \e0x |
| 482 |
escapes, or as \ex{...} escapes if the \fB/8\fP modifier was present on the |
escapes, or as \ex{...} escapes if the \fB/8\fP modifier was present on the |
| 483 |
pattern. See below for the definition of non-printing characters. If the |
pattern. See below for the definition of non-printing characters. If the |
| 558 |
match with additional subject data by means of the \eR escape sequence. For |
match with additional subject data by means of the \eR escape sequence. For |
| 559 |
example: |
example: |
| 560 |
.sp |
.sp |
| 561 |
re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ |
re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/ |
| 562 |
data> 23ja\eP\eD |
data> 23ja\eP\eD |
| 563 |
Partial match: 23ja |
Partial match: 23ja |
| 564 |
data> n05\eR\eD |
data> n05\eR\eD |
| 711 |
.rs |
.rs |
| 712 |
.sp |
.sp |
| 713 |
.nf |
.nf |
| 714 |
Last updated: 16 April 2007 |
Last updated: 19 November 2007 |
| 715 |
Copyright (c) 1997-2007 University of Cambridge. |
Copyright (c) 1997-2007 University of Cambridge. |
| 716 |
.fi |
.fi |