39 |
<pre> |
<pre> |
40 |
(?C1)abc(?C2)def |
(?C1)abc(?C2)def |
41 |
</pre> |
</pre> |
42 |
If the PCRE_AUTO_CALLOUT option bit is set when <b>pcre_compile()</b> is called, |
If the PCRE_AUTO_CALLOUT option bit is set when <b>pcre_compile()</b> or |
43 |
PCRE automatically inserts callouts, all with number 255, before each item in |
<b>pcre_compile2()</b> is called, PCRE automatically inserts callouts, all with |
44 |
the pattern. For example, if PCRE_AUTO_CALLOUT is used with the pattern |
number 255, before each item in the pattern. For example, if PCRE_AUTO_CALLOUT |
45 |
|
is used with the pattern |
46 |
<pre> |
<pre> |
47 |
A(\d{2}|--) |
A(\d{2}|--) |
48 |
</pre> |
</pre> |
74 |
no match, the callout is obeyed. |
no match, the callout is obeyed. |
75 |
</P> |
</P> |
76 |
<P> |
<P> |
77 |
|
If the pattern is studied, PCRE knows the minimum length of a matching string, |
78 |
|
and will immediately give a "no match" return without actually running a match |
79 |
|
if the subject is not long enough, or, for unanchored patterns, if it has |
80 |
|
been scanned far enough. |
81 |
|
</P> |
82 |
|
<P> |
83 |
You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE |
You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE |
84 |
option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b>. This slows down the |
option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b>. This slows down the |
85 |
matching process, but does ensure that callouts such as the example above are |
matching process, but does ensure that callouts such as the example above are |
186 |
matching proceeds as normal. If the value is greater than zero, matching fails |
matching proceeds as normal. If the value is greater than zero, matching fails |
187 |
at the current point, but the testing of other matching possibilities goes |
at the current point, but the testing of other matching possibilities goes |
188 |
ahead, just as if a lookahead assertion had failed. If the value is less than |
ahead, just as if a lookahead assertion had failed. If the value is less than |
189 |
zero, the match is abandoned, and <b>pcre_exec()</b> (or <b>pcre_dfa_exec()</b>) |
zero, the match is abandoned, and <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> |
190 |
returns the negative value. |
returns the negative value. |
191 |
</P> |
</P> |
192 |
<P> |
<P> |
206 |
</P> |
</P> |
207 |
<br><a name="SEC6" href="#TOC1">REVISION</a><br> |
<br><a name="SEC6" href="#TOC1">REVISION</a><br> |
208 |
<P> |
<P> |
209 |
Last updated: 15 March 2009 |
Last updated: 29 September 2009 |
210 |
<br> |
<br> |
211 |
Copyright © 1997-2009 University of Cambridge. |
Copyright © 1997-2009 University of Cambridge. |
212 |
<br> |
<br> |