| 254 |
If any call to <b>pcre_exec()</b> in a <b>/g</b> or <b>/G</b> sequence matches an |
If any call to <b>pcre_exec()</b> in a <b>/g</b> or <b>/G</b> sequence matches an |
| 255 |
empty string, the next call is done with the PCRE_NOTEMPTY_ATSTART and |
empty string, the next call is done with the PCRE_NOTEMPTY_ATSTART and |
| 256 |
PCRE_ANCHORED flags set in order to search for another, non-empty, match at the |
PCRE_ANCHORED flags set in order to search for another, non-empty, match at the |
| 257 |
same point. If this second match fails, the start offset is advanced by one |
same point. If this second match fails, the start offset is advanced, and the |
| 258 |
character, and the normal match is retried. This imitates the way Perl handles |
normal match is retried. This imitates the way Perl handles such cases when |
| 259 |
such cases when using the <b>/g</b> modifier or the <b>split()</b> function. |
using the <b>/g</b> modifier or the <b>split()</b> function. Normally, the start |
| 260 |
|
offset is advanced by one character, but if the newline convention recognizes |
| 261 |
|
CRLF as a newline, and the current character is CR followed by LF, an advance |
| 262 |
|
of two is used. |
| 263 |
</P> |
</P> |
| 264 |
<br><b> |
<br><b> |
| 265 |
Other modifiers |
Other modifiers |
| 415 |
\Y pass the PCRE_NO_START_OPTIMIZE option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
\Y pass the PCRE_NO_START_OPTIMIZE option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 416 |
\Z pass the PCRE_NOTEOL option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
\Z pass the PCRE_NOTEOL option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 417 |
\? pass the PCRE_NO_UTF8_CHECK option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
\? pass the PCRE_NO_UTF8_CHECK option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 418 |
\>dd start the match at offset dd (any number of digits); |
\>dd start the match at offset dd (optional "-"; then any number of digits); this sets the <i>startoffset</i> |
| 419 |
this sets the <i>startoffset</i> argument for <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
argument for <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 420 |
\<cr> pass the PCRE_NEWLINE_CR option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
\<cr> pass the PCRE_NEWLINE_CR option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 421 |
\<lf> pass the PCRE_NEWLINE_LF option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
\<lf> pass the PCRE_NEWLINE_LF option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 422 |
\<crlf> pass the PCRE_NEWLINE_CRLF option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
\<crlf> pass the PCRE_NEWLINE_CRLF option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
| 492 |
<b>pcre_exec()</b> returns, starting with number 0 for the string that matched |
<b>pcre_exec()</b> returns, starting with number 0 for the string that matched |
| 493 |
the whole pattern. Otherwise, it outputs "No match" when the return is |
the whole pattern. Otherwise, it outputs "No match" when the return is |
| 494 |
PCRE_ERROR_NOMATCH, and "Partial match:" followed by the partially matching |
PCRE_ERROR_NOMATCH, and "Partial match:" followed by the partially matching |
| 495 |
substring when <b>pcre_exec()</b> returns PCRE_ERROR_PARTIAL. For any other |
substring when <b>pcre_exec()</b> returns PCRE_ERROR_PARTIAL. (Note that this is |
| 496 |
returns, it outputs the PCRE negative error number. Here is an example of an |
the entire substring that was inspected during the partial match; it may |
| 497 |
interactive <b>pcretest</b> run. |
include characters before the actual match start if a lookbehind assertion, |
| 498 |
|
\K, \b, or \B was involved.) For any other returns, it outputs the PCRE |
| 499 |
|
negative error number. Here is an example of an interactive <b>pcretest</b> run. |
| 500 |
<pre> |
<pre> |
| 501 |
$ pcretest |
$ pcretest |
| 502 |
PCRE version 7.0 30-Nov-2006 |
PCRE version 7.0 30-Nov-2006 |
| 578 |
(Using the normal matching function on this data finds only "tang".) The |
(Using the normal matching function on this data finds only "tang".) The |
| 579 |
longest matching string is always given first (and numbered zero). After a |
longest matching string is always given first (and numbered zero). After a |
| 580 |
PCRE_ERROR_PARTIAL return, the output is "Partial match:", followed by the |
PCRE_ERROR_PARTIAL return, the output is "Partial match:", followed by the |
| 581 |
partially matching substring. |
partially matching substring. (Note that this is the entire substring that was |
| 582 |
|
inspected during the partial match; it may include characters before the actual |
| 583 |
|
match start if a lookbehind assertion, \K, \b, or \B was involved.) |
| 584 |
</P> |
</P> |
| 585 |
<P> |
<P> |
| 586 |
If <b>/g</b> is present on the pattern, the search for further matches resumes |
If <b>/g</b> is present on the pattern, the search for further matches resumes |
| 747 |
</P> |
</P> |
| 748 |
<br><a name="SEC15" href="#TOC1">REVISION</a><br> |
<br><a name="SEC15" href="#TOC1">REVISION</a><br> |
| 749 |
<P> |
<P> |
| 750 |
Last updated: 14 June 2010 |
Last updated: 06 November 2010 |
| 751 |
<br> |
<br> |
| 752 |
Copyright © 1997-2010 University of Cambridge. |
Copyright © 1997-2010 University of Cambridge. |
| 753 |
<br> |
<br> |