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

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

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

revision 111 by ph10, Thu Mar 8 16:53:09 2007 UTC revision 392 by ph10, Tue Mar 17 21:30:30 2009 UTC
# Line 37  function is to be called. Different call Line 37  function is to be called. Different call
37  a number less than 256 after the letter C. The default value is zero.  a number less than 256 after the letter C. The default value is zero.
38  For example, this pattern has two callout points:  For example, this pattern has two callout points:
39  <pre>  <pre>
40    (?C1)\deabc(?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> is called,
43  PCRE automatically inserts callouts, all with number 255, before each item in  PCRE automatically inserts callouts, all with number 255, before each item in
# Line 62  trying to optimize the performance of a Line 62  trying to optimize the performance of a
62  <br><a name="SEC2" href="#TOC1">MISSING CALLOUTS</a><br>  <br><a name="SEC2" href="#TOC1">MISSING CALLOUTS</a><br>
63  <P>  <P>
64  You should be aware that, because of optimizations in the way PCRE matches  You should be aware that, because of optimizations in the way PCRE matches
65  patterns, callouts sometimes do not happen. For example, if the pattern is  patterns by default, callouts sometimes do not happen. For example, if the
66    pattern is
67  <pre>  <pre>
68    ab(?C4)cd    ab(?C4)cd
69  </pre>  </pre>
# Line 71  string is "abyz", the lack of "d" means Line 72  string is "abyz", the lack of "d" means
72  the callout is never reached. However, with "abyd", though the result is still  the callout is never reached. However, with "abyd", though the result is still
73  no match, the callout is obeyed.  no match, the callout is obeyed.
74  </P>  </P>
75    <P>
76    You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE
77    option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b>. This slows down the
78    matching process, but does ensure that callouts such as the example above are
79    obeyed.
80    </P>
81  <br><a name="SEC3" href="#TOC1">THE CALLOUT INTERFACE</a><br>  <br><a name="SEC3" href="#TOC1">THE CALLOUT INTERFACE</a><br>
82  <P>  <P>
83  During matching, when PCRE reaches a callout point, the external function  During matching, when PCRE reaches a callout point, the external function
# Line 115  The <i>subject</i> and <i>subject_length Line 122  The <i>subject</i> and <i>subject_length
122  that were passed to <b>pcre_exec()</b>.  that were passed to <b>pcre_exec()</b>.
123  </P>  </P>
124  <P>  <P>
125  The <i>start_match</i> field contains the offset within the subject at which the  The <i>start_match</i> field normally contains the offset within the subject at
126  current match attempt started. If the pattern is not anchored, the callout  which the current match attempt started. However, if the escape sequence \K
127  function may be called several times from the same point in the pattern for  has been encountered, this value is changed to reflect the modified starting
128  different starting points in the subject.  point. If the pattern is not anchored, the callout function may be called
129    several times from the same point in the pattern for different starting points
130    in the subject.
131  </P>  </P>
132  <P>  <P>
133  The <i>current_position</i> field contains the offset within the subject of the  The <i>current_position</i> field contains the offset within the subject of the
# Line 190  Cambridge CB2 3QH, England. Line 199  Cambridge CB2 3QH, England.
199  </P>  </P>
200  <br><a name="SEC6" href="#TOC1">REVISION</a><br>  <br><a name="SEC6" href="#TOC1">REVISION</a><br>
201  <P>  <P>
202  Last updated: 06 March 2007  Last updated: 15 March 2009
203  <br>  <br>
204  Copyright &copy; 1997-2007 University of Cambridge.  Copyright &copy; 1997-2009 University of Cambridge.
205  <br>  <br>
206  <p>  <p>
207  Return to the <a href="index.html">PCRE index page</a>.  Return to the <a href="index.html">PCRE index page</a>.

Legend:
Removed from v.111  
changed lines
  Added in v.392

  ViewVC Help
Powered by ViewVC 1.1.5