/[pcre]/code/trunk/doc/html/pcreprecompile.html
ViewVC logotype

Diff of /code/trunk/doc/html/pcreprecompile.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 75 by nigel, Sat Feb 24 21:40:37 2007 UTC revision 155 by ph10, Tue Apr 24 13:36:11 2007 UTC
# Line 17  man page, in case the conversion went wr Line 17  man page, in case the conversion went wr
17  <li><a name="TOC2" href="#SEC2">SAVING A COMPILED PATTERN</a>  <li><a name="TOC2" href="#SEC2">SAVING A COMPILED PATTERN</a>
18  <li><a name="TOC3" href="#SEC3">RE-USING A PRECOMPILED PATTERN</a>  <li><a name="TOC3" href="#SEC3">RE-USING A PRECOMPILED PATTERN</a>
19  <li><a name="TOC4" href="#SEC4">COMPATIBILITY WITH DIFFERENT PCRE RELEASES</a>  <li><a name="TOC4" href="#SEC4">COMPATIBILITY WITH DIFFERENT PCRE RELEASES</a>
20    <li><a name="TOC5" href="#SEC5">AUTHOR</a>
21    <li><a name="TOC6" href="#SEC6">REVISION</a>
22  </ul>  </ul>
23  <br><a name="SEC1" href="#TOC1">SAVING AND RE-USING PRECOMPILED PCRE PATTERNS</a><br>  <br><a name="SEC1" href="#TOC1">SAVING AND RE-USING PRECOMPILED PCRE PATTERNS</a><br>
24  <P>  <P>
# Line 32  tables, it is a little bit more complica Line 34  tables, it is a little bit more complica
34  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
35  and run them there. This works even if the new host has the opposite endianness  and run them there. This works even if the new host has the opposite endianness
36  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
37  performance penalty, but it should be insignificant.  performance penalty, but it should be insignificant. However, compiling regular
38    expressions with one version of PCRE for use with a different version is not
39    guaranteed to work and may cause crashes.
40  </P>  </P>
41  <br><a name="SEC2" href="#TOC1">SAVING A COMPILED PATTERN</a><br>  <br><a name="SEC2" href="#TOC1">SAVING A COMPILED PATTERN</a><br>
42  <P>  <P>
# Line 88  return a non-NULL value before trying to Line 92  return a non-NULL value before trying to
92  <br><a name="SEC3" href="#TOC1">RE-USING A PRECOMPILED PATTERN</a><br>  <br><a name="SEC3" href="#TOC1">RE-USING A PRECOMPILED PATTERN</a><br>
93  <P>  <P>
94  Re-using a precompiled pattern is straightforward. Having reloaded it into main  Re-using a precompiled pattern is straightforward. Having reloaded it into main
95  memory, you pass its pointer to <b>pcre_exec()</b> in the usual way. This should  memory, you pass its pointer to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> in
96  work even on another host, and even if that host has the opposite endianness to  the usual way. This should work even on another host, and even if that host has
97  the one where the pattern was compiled.  the opposite endianness to the one where the pattern was compiled.
98  </P>  </P>
99  <P>  <P>
100  However, if you passed a pointer to custom character tables when the pattern  However, if you passed a pointer to custom character tables when the pattern
101  was compiled (the <i>tableptr</i> argument of <b>pcre_compile()</b>), you must  was compiled (the <i>tableptr</i> argument of <b>pcre_compile()</b>), you must
102  now pass a similar pointer to <b>pcre_exec()</b>, because the value saved with  now pass a similar pointer to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b>,
103  the compiled pattern will obviously be nonsense. A field in a  because the value saved with the compiled pattern will obviously be nonsense. A
104  <b>pcre_extra()</b> block is used to pass this data, as described in the  field in a <b>pcre_extra()</b> block is used to pass this data, as described in
105    the
106  <a href="pcreapi.html#extradata">section on matching a pattern</a>  <a href="pcreapi.html#extradata">section on matching a pattern</a>
107  in the  in the
108  <a href="pcreapi.html"><b>pcreapi</b></a>  <a href="pcreapi.html"><b>pcreapi</b></a>
# Line 114  If you saved study data with the compile Line 119  If you saved study data with the compile
119  <b>pcre_extra</b> data block and set the <i>study_data</i> field to point to the  <b>pcre_extra</b> data block and set the <i>study_data</i> field to point to the
120  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
121  <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
122  <b>pcre_extra</b> block to <b>pcre_exec()</b> in the usual way.  <b>pcre_extra</b> block to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b> in the
123    usual way.
124  </P>  </P>
125  <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>
126  <P>  <P>
127  The layout of the control block that is at the start of the data that makes up  The layout of the control block that is at the start of the data that makes up
128  a compiled pattern was changed for release 5.0. If you have any saved patterns  a compiled pattern was changed for release 5.0. If you have any saved patterns
129  that were compiled with previous releases (not a facility that was previously  that were compiled with previous releases (not a facility that was previously
130  advertised), you will have to recompile them for release 5.0. However, from now  advertised), you will have to recompile them for release 5.0 and above.
 on, it should be possible to make changes in a compabible manner.  
131  </P>  </P>
132  <P>  <P>
133  Last updated: 10 September 2004  If you have any saved patterns in UTF-8 mode that use \p or \P that were
134    compiled with any release up to and including 6.4, you will have to recompile
135    them for release 6.5 and above.
136    </P>
137    <P>
138    All saved patterns from earlier releases must be recompiled for release 7.0 or
139    higher, because there was an internal reorganization at that release.
140    </P>
141    <br><a name="SEC5" href="#TOC1">AUTHOR</a><br>
142    <P>
143    Philip Hazel
144    <br>
145    University Computing Service
146    <br>
147    Cambridge CB2 3QH, England.
148    <br>
149    </P>
150    <br><a name="SEC6" href="#TOC1">REVISION</a><br>
151    <P>
152    Last updated: 24 April 2007
153    <br>
154    Copyright &copy; 1997-2007 University of Cambridge.
155  <br>  <br>
 Copyright &copy; 1997-2004 University of Cambridge.  
156  <p>  <p>
157  Return to the <a href="index.html">PCRE index page</a>.  Return to the <a href="index.html">PCRE index page</a>.
158  </p>  </p>

Legend:
Removed from v.75  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.5