| 58 |
are set, PCRE_PARTIAL_HARD takes precedence. |
are set, PCRE_PARTIAL_HARD takes precedence. |
| 59 |
</P> |
</P> |
| 60 |
<P> |
<P> |
| 61 |
If you want to use partial matching with just-in-time optimized code, you must |
If you want to use partial matching with just-in-time optimized code, you must |
| 62 |
call <b>pcre_study()</b> or <b>pcre16_study()</b> with one or both of these |
call <b>pcre_study()</b> or <b>pcre16_study()</b> with one or both of these |
| 63 |
options: |
options: |
| 64 |
<pre> |
<pre> |
| 65 |
PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE |
PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE |
| 66 |
PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE |
PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE |
| 67 |
</pre> |
</pre> |
| 68 |
PCRE_STUDY_JIT_COMPILE should also be set if you are going to run non-partial |
PCRE_STUDY_JIT_COMPILE should also be set if you are going to run non-partial |
| 69 |
matches on the same pattern. If the appropriate JIT study mode has not been set |
matches on the same pattern. If the appropriate JIT study mode has not been set |
| 70 |
for a match, the interpretive matching code is used. |
for a match, the interpretive matching code is used. |
| 71 |
</P> |
</P> |
| 354 |
<P> |
<P> |
| 355 |
2. Lookbehind assertions that have already been obeyed are catered for in the |
2. Lookbehind assertions that have already been obeyed are catered for in the |
| 356 |
offsets that are returned for a partial match. However a lookbehind assertion |
offsets that are returned for a partial match. However a lookbehind assertion |
| 357 |
later in the pattern could require even earlier characters to be inspected. You |
later in the pattern could require even earlier characters to be inspected. You |
| 358 |
can handle this case by using the PCRE_INFO_MAXLOOKBEHIND option of the |
can handle this case by using the PCRE_INFO_MAXLOOKBEHIND option of the |
| 359 |
<b>pcre_fullinfo()</b> or <b>pcre16_fullinfo()</b> functions to obtain the length |
<b>pcre_fullinfo()</b> or <b>pcre16_fullinfo()</b> functions to obtain the length |
| 360 |
of the largest lookbehind in the pattern. This length is given in characters, |
of the largest lookbehind in the pattern. This length is given in characters, |
| 361 |
not bytes. If you always retain at least that many characters before the |
not bytes. If you always retain at least that many characters before the |
| 372 |
data> ab\P |
data> ab\P |
| 373 |
No match |
No match |
| 374 |
</pre> |
</pre> |
| 375 |
If the next segment begins "cx", a match should be found, but this will only |
If the next segment begins "cx", a match should be found, but this will only |
| 376 |
happen if characters from the previous segment are retained. For this reason, a |
happen if characters from the previous segment are retained. For this reason, a |
| 377 |
"no match" result should be interpreted as "partial match of an empty string" |
"no match" result should be interpreted as "partial match of an empty string" |
| 378 |
when the pattern contains lookbehinds. |
when the pattern contains lookbehinds. |