1246 |
.sp |
.sp |
1247 |
The unused bits of the \fIoptions\fP argument for \fBpcre_exec()\fP must be |
The unused bits of the \fIoptions\fP argument for \fBpcre_exec()\fP must be |
1248 |
zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP, |
zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP, |
1249 |
PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_START_OPTIMIZE, |
PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, |
1250 |
PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_SOFT, and PCRE_PARTIAL_HARD. |
PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_SOFT, and |
1251 |
|
PCRE_PARTIAL_HARD. |
1252 |
.sp |
.sp |
1253 |
PCRE_ANCHORED |
PCRE_ANCHORED |
1254 |
.sp |
.sp |
1323 |
.sp |
.sp |
1324 |
a?b? |
a?b? |
1325 |
.sp |
.sp |
1326 |
is applied to a string not beginning with "a" or "b", it matches the empty |
is applied to a string not beginning with "a" or "b", it matches an empty |
1327 |
string at the start of the subject. With PCRE_NOTEMPTY set, this match is not |
string at the start of the subject. With PCRE_NOTEMPTY set, this match is not |
1328 |
valid, so PCRE searches further into the string for occurrences of "a" or "b". |
valid, so PCRE searches further into the string for occurrences of "a" or "b". |
1329 |
.P |
.sp |
1330 |
Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case |
PCRE_NOTEMPTY_ATSTART |
1331 |
of a pattern match of the empty string within its \fBsplit()\fP function, and |
.sp |
1332 |
when using the /g modifier. It is possible to emulate Perl's behaviour after |
This is like PCRE_NOTEMPTY, except that an empty string match that is not at |
1333 |
matching a null string by first trying the match again at the same offset with |
the start of the subject is permitted. If the pattern is anchored, such a match |
1334 |
PCRE_NOTEMPTY and PCRE_ANCHORED, and then if that fails by advancing the |
can occur only if the pattern contains \eK. |
1335 |
starting offset (see below) and trying an ordinary match again. There is some |
.P |
1336 |
code that demonstrates how to do this in the |
Perl has no direct equivalent of PCRE_NOTEMPTY or PCRE_NOTEMPTY_ATSTART, but it |
1337 |
|
does make a special case of a pattern match of the empty string within its |
1338 |
|
\fBsplit()\fP function, and when using the /g modifier. It is possible to |
1339 |
|
emulate Perl's behaviour after matching a null string by first trying the match |
1340 |
|
again at the same offset with PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED, and then |
1341 |
|
if that fails, by advancing the starting offset (see below) and trying an |
1342 |
|
ordinary match again. There is some code that demonstrates how to do this in |
1343 |
|
the |
1344 |
.\" HREF |
.\" HREF |
1345 |
\fBpcredemo\fP |
\fBpcredemo\fP |
1346 |
.\" |
.\" |
1883 |
.sp |
.sp |
1884 |
The unused bits of the \fIoptions\fP argument for \fBpcre_dfa_exec()\fP must be |
The unused bits of the \fIoptions\fP argument for \fBpcre_dfa_exec()\fP must be |
1885 |
zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP, |
zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP, |
1886 |
PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, |
PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, |
1887 |
PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last |
PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST, |
1888 |
four of these are exactly the same as for \fBpcre_exec()\fP, so their |
and PCRE_DFA_RESTART. All but the last four of these are exactly the same as |
1889 |
description is not repeated here. |
for \fBpcre_exec()\fP, so their description is not repeated here. |
1890 |
.sp |
.sp |
1891 |
PCRE_PARTIAL_HARD |
PCRE_PARTIAL_HARD |
1892 |
PCRE_PARTIAL_SOFT |
PCRE_PARTIAL_SOFT |
2020 |
.rs |
.rs |
2021 |
.sp |
.sp |
2022 |
.nf |
.nf |
2023 |
Last updated: 09 September 2009 |
Last updated: 11 September 2009 |
2024 |
Copyright (c) 1997-2009 University of Cambridge. |
Copyright (c) 1997-2009 University of Cambridge. |
2025 |
.fi |
.fi |