/[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 182 by ph10, Wed Jun 13 15:09:54 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  In general, it is safest to recompile all saved patterns when you update to a
128  a compiled pattern was changed for release 5.0. If you have any saved patterns  new PCRE release, though not all updates actually require this. Recompiling is
129  that were compiled with previous releases (not a facility that was previously  definitely needed for release 7.2.
 advertised), you will have to recompile them for release 5.0. However, from now  
 on, it should be possible to make changes in a compabible manner.  
130  </P>  </P>
131    <br><a name="SEC5" href="#TOC1">AUTHOR</a><br>
132  <P>  <P>
133  Last updated: 10 September 2004  Philip Hazel
134    <br>
135    University Computing Service
136    <br>
137    Cambridge CB2 3QH, England.
138    <br>
139    </P>
140    <br><a name="SEC6" href="#TOC1">REVISION</a><br>
141    <P>
142    Last updated: 13 June 2007
143    <br>
144    Copyright &copy; 1997-2007 University of Cambridge.
145  <br>  <br>
 Copyright &copy; 1997-2004 University of Cambridge.  
146  <p>  <p>
147  Return to the <a href="index.html">PCRE index page</a>.  Return to the <a href="index.html">PCRE index page</a>.
148  </p>  </p>

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

  ViewVC Help
Powered by ViewVC 1.1.5