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

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

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

revision 392 by ph10, Tue Mar 17 21:30:30 2009 UTC revision 456 by ph10, Fri Oct 2 08:53:31 2009 UTC
# Line 19  For example, this pattern has two callou Line 19  For example, this pattern has two callou
19  .sp  .sp
20    (?C1)abc(?C2)def    (?C1)abc(?C2)def
21  .sp  .sp
22  If the PCRE_AUTO_CALLOUT option bit is set when \fBpcre_compile()\fP is called,  If the PCRE_AUTO_CALLOUT option bit is set when \fBpcre_compile()\fP or
23  PCRE automatically inserts callouts, all with number 255, before each item in  \fBpcre_compile2()\fP is called, PCRE automatically inserts callouts, all with
24  the pattern. For example, if PCRE_AUTO_CALLOUT is used with the pattern  number 255, before each item in the pattern. For example, if PCRE_AUTO_CALLOUT
25    is used with the pattern
26  .sp  .sp
27    A(\ed{2}|--)    A(\ed{2}|--)
28  .sp  .sp
# Line 54  string is "abyz", the lack of "d" means Line 55  string is "abyz", the lack of "d" means
55  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
56  no match, the callout is obeyed.  no match, the callout is obeyed.
57  .P  .P
58    If the pattern is studied, PCRE knows the minimum length of a matching string,
59    and will immediately give a "no match" return without actually running a match
60    if the subject is not long enough, or, for unanchored patterns, if it has
61    been scanned far enough.
62    .P
63  You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE  You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE
64  option to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. This slows down the  option to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. This slows down the
65  matching process, but does ensure that callouts such as the example above are  matching process, but does ensure that callouts such as the example above are
# Line 155  The external callout function returns an Line 161  The external callout function returns an
161  matching proceeds as normal. If the value is greater than zero, matching fails  matching proceeds as normal. If the value is greater than zero, matching fails
162  at the current point, but the testing of other matching possibilities goes  at the current point, but the testing of other matching possibilities goes
163  ahead, just as if a lookahead assertion had failed. If the value is less than  ahead, just as if a lookahead assertion had failed. If the value is less than
164  zero, the match is abandoned, and \fBpcre_exec()\fP (or \fBpcre_dfa_exec()\fP)  zero, the match is abandoned, and \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP
165  returns the negative value.  returns the negative value.
166  .P  .P
167  Negative values should normally be chosen from the set of PCRE_ERROR_xxx  Negative values should normally be chosen from the set of PCRE_ERROR_xxx
# Line 178  Cambridge CB2 3QH, England. Line 184  Cambridge CB2 3QH, England.
184  .rs  .rs
185  .sp  .sp
186  .nf  .nf
187  Last updated: 15 March 2009  Last updated: 29 September 2009
188  Copyright (c) 1997-2009 University of Cambridge.  Copyright (c) 1997-2009 University of Cambridge.
189  .fi  .fi

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

  ViewVC Help
Powered by ViewVC 1.1.5