| 2565 |
that is, if the closing parenthesis immediately follows the colon, the effect |
that is, if the closing parenthesis immediately follows the colon, the effect |
| 2566 |
is as if the colon were not there. Any number of these verbs may occur in a |
is as if the colon were not there. Any number of these verbs may occur in a |
| 2567 |
pattern. |
pattern. |
| 2568 |
</P> |
<a name="nooptimize"></a></P> |
| 2569 |
|
<br><b> |
| 2570 |
|
Optimizations that affect backtracking verbs |
| 2571 |
|
</b><br> |
| 2572 |
<P> |
<P> |
| 2573 |
PCRE contains some optimizations that are used to speed up matching by running |
PCRE contains some optimizations that are used to speed up matching by running |
| 2574 |
some checks at the start of each match attempt. For example, it may know the |
some checks at the start of each match attempt. For example, it may know the |
| 2577 |
included backtracking verbs will not, of course, be processed. You can suppress |
included backtracking verbs will not, of course, be processed. You can suppress |
| 2578 |
the start-of-match optimizations by setting the PCRE_NO_START_OPTIMIZE option |
the start-of-match optimizations by setting the PCRE_NO_START_OPTIMIZE option |
| 2579 |
when calling <b>pcre_compile()</b> or <b>pcre_exec()</b>, or by starting the |
when calling <b>pcre_compile()</b> or <b>pcre_exec()</b>, or by starting the |
| 2580 |
pattern with (*NO_START_OPT). |
pattern with (*NO_START_OPT). There is more discussion of this option in the |
| 2581 |
|
section entitled |
| 2582 |
|
<a href="pcreapi.html#execoptions">"Option bits for <b>pcre_exec()</b>"</a> |
| 2583 |
|
in the |
| 2584 |
|
<a href="pcreapi.html"><b>pcreapi</b></a> |
| 2585 |
|
documentation. |
| 2586 |
</P> |
</P> |
| 2587 |
<P> |
<P> |
| 2588 |
Experiments with Perl suggest that it too has similar optimizations, sometimes |
Experiments with Perl suggest that it too has similar optimizations, sometimes |
| 2670 |
No match, mark = B |
No match, mark = B |
| 2671 |
</pre> |
</pre> |
| 2672 |
Note that in this unanchored example the mark is retained from the match |
Note that in this unanchored example the mark is retained from the match |
| 2673 |
attempt that started at the letter "X". Subsequent match attempts starting at |
attempt that started at the letter "X" in the subject. Subsequent match |
| 2674 |
"P" and then with an empty string do not get as far as the (*MARK) item, but |
attempts starting at "P" and then with an empty string do not get as far as the |
| 2675 |
nevertheless do not reset it. |
(*MARK) item, but nevertheless do not reset it. |
| 2676 |
|
</P> |
| 2677 |
|
<P> |
| 2678 |
|
If you are interested in (*MARK) values after failed matches, you should |
| 2679 |
|
probably set the PCRE_NO_START_OPTIMIZE option |
| 2680 |
|
<a href="#nooptimize">(see above)</a> |
| 2681 |
|
to ensure that the match is always attempted. |
| 2682 |
</P> |
</P> |
| 2683 |
<br><b> |
<br><b> |
| 2684 |
Verbs that act after backtracking |
Verbs that act after backtracking |
| 2857 |
</P> |
</P> |
| 2858 |
<br><a name="SEC28" href="#TOC1">REVISION</a><br> |
<br><a name="SEC28" href="#TOC1">REVISION</a><br> |
| 2859 |
<P> |
<P> |
| 2860 |
Last updated: 09 January 2012 |
Last updated: 24 February 2012 |
| 2861 |
<br> |
<br> |
| 2862 |
Copyright © 1997-2012 University of Cambridge. |
Copyright © 1997-2012 University of Cambridge. |
| 2863 |
<br> |
<br> |