| 28 |
If you are not using any private character tables (see the |
If you are not using any private character tables (see the |
| 29 |
<a href="pcre_maketables.html"><b>pcre_maketables()</b></a> |
<a href="pcre_maketables.html"><b>pcre_maketables()</b></a> |
| 30 |
documentation), this is relatively straightforward. If you are using private |
documentation), this is relatively straightforward. If you are using private |
| 31 |
tables, it is a little bit more complicated. |
tables, it is a little bit more complicated. However, if you are using the |
| 32 |
|
just-in-time optimization feature of <b>pcre_study()</b>, it is not possible to |
| 33 |
|
save and reload the JIT data. |
| 34 |
</P> |
</P> |
| 35 |
<P> |
<P> |
| 36 |
If you save compiled patterns to a file, you can copy them to a different host |
If you save compiled patterns to a file, you can copy them to a different host |
| 38 |
to the one on which the patterns were compiled. There may be a small |
to the one on which the patterns were compiled. There may be a small |
| 39 |
performance penalty, but it should be insignificant. However, compiling regular |
performance penalty, but it should be insignificant. However, compiling regular |
| 40 |
expressions with one version of PCRE for use with a different version is not |
expressions with one version of PCRE for use with a different version is not |
| 41 |
guaranteed to work and may cause crashes. |
guaranteed to work and may cause crashes, and saving and restoring a compiled |
| 42 |
|
pattern loses any JIT optimization data. |
| 43 |
</P> |
</P> |
| 44 |
<br><a name="SEC2" href="#TOC1">SAVING A COMPILED PATTERN</a><br> |
<br><a name="SEC2" href="#TOC1">SAVING A COMPILED PATTERN</a><br> |
| 45 |
<P> |
<P> |
| 79 |
them. |
them. |
| 80 |
</P> |
</P> |
| 81 |
<P> |
<P> |
| 82 |
If the pattern has been studied, it is also possible to save the study data in |
If the pattern has been studied, it is also possible to save the normal study |
| 83 |
a similar way to the compiled pattern itself. When studying generates |
data in a similar way to the compiled pattern itself. However, if the |
| 84 |
additional information, <b>pcre_study()</b> returns a pointer to a |
PCRE_STUDY_JIT_COMPILE was used, the just-in-time data that is created cannot |
| 85 |
|
be saved because it is too dependent on the current environment. When studying |
| 86 |
|
generates additional information, <b>pcre_study()</b> returns a pointer to a |
| 87 |
<b>pcre_extra</b> data block. Its format is defined in the |
<b>pcre_extra</b> data block. Its format is defined in the |
| 88 |
<a href="pcreapi.html#extradata">section on matching a pattern</a> |
<a href="pcreapi.html#extradata">section on matching a pattern</a> |
| 89 |
in the |
in the |
| 125 |
reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in the |
reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in the |
| 126 |
<i>flags</i> field to indicate that study data is present. Then pass the |
<i>flags</i> field to indicate that study data is present. Then pass the |
| 127 |
<b>pcre_extra</b> block to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> in the |
<b>pcre_extra</b> block to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> in the |
| 128 |
usual way. |
usual way. If the pattern was studied for just-in-time optimization, that data |
| 129 |
|
cannot be saved, and so is lost by a save/restore cycle. |
| 130 |
</P> |
</P> |
| 131 |
<br><a name="SEC4" href="#TOC1">COMPATIBILITY WITH DIFFERENT PCRE RELEASES</a><br> |
<br><a name="SEC4" href="#TOC1">COMPATIBILITY WITH DIFFERENT PCRE RELEASES</a><br> |
| 132 |
<P> |
<P> |
| 144 |
</P> |
</P> |
| 145 |
<br><a name="SEC6" href="#TOC1">REVISION</a><br> |
<br><a name="SEC6" href="#TOC1">REVISION</a><br> |
| 146 |
<P> |
<P> |
| 147 |
Last updated: 17 November 2010 |
Last updated: 26 August 2011 |
| 148 |
<br> |
<br> |
| 149 |
Copyright © 1997-2010 University of Cambridge. |
Copyright © 1997-2011 University of Cambridge. |
| 150 |
<br> |
<br> |
| 151 |
<p> |
<p> |
| 152 |
Return to the <a href="index.html">PCRE index page</a>. |
Return to the <a href="index.html">PCRE index page</a>. |