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

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

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

revision 868 by ph10, Wed Dec 28 17:16:11 2011 UTC revision 869 by ph10, Sat Jan 14 11:16:23 2012 UTC
# Line 26  man page, in case the conversion went wr Line 26  man page, in case the conversion went wr
26  <P>  <P>
27  This document describes the two different algorithms that are available in PCRE  This document describes the two different algorithms that are available in PCRE
28  for matching a compiled regular expression against a given subject string. The  for matching a compiled regular expression against a given subject string. The
29  "standard" algorithm is the one provided by the <b>pcre_exec()</b> function.  "standard" algorithm is the one provided by the <b>pcre_exec()</b> and
30  This works in the same was as Perl's matching function, and provides a  <b>pcre16_exec()</b> functions. These work in the same was as Perl's matching
31  Perl-compatible matching operation.  function, and provide a Perl-compatible matching operation. The just-in-time
32    (JIT) optimization that is described in the
33    <a href="pcrejit.html"><b>pcrejit</b></a>
34    documentation is compatible with these functions.
35  </P>  </P>
36  <P>  <P>
37  An alternative algorithm is provided by the <b>pcre_dfa_exec()</b> function;  An alternative algorithm is provided by the <b>pcre_dfa_exec()</b> and
38  this operates in a different way, and is not Perl-compatible. It has advantages  <b>pcre16_dfa_exec()</b> functions; they operate in a different way, and are not
39  and disadvantages compared with the standard algorithm, and these are described  Perl-compatible. This alternative has advantages and disadvantages compared
40  below.  with the standard algorithm, and these are described below.
41  </P>  </P>
42  <P>  <P>
43  When there is only one possible way in which a given subject string can match a  When there is only one possible way in which a given subject string can match a
# Line 163  and not on others), is not supported. It Line 166  and not on others), is not supported. It
166  always 1, and the value of the <i>capture_last</i> field is always -1.  always 1, and the value of the <i>capture_last</i> field is always -1.
167  </P>  </P>
168  <P>  <P>
169  7. The \C escape sequence, which (in the standard algorithm) matches a single  7. The \C escape sequence, which (in the standard algorithm) always matches a
170  byte, even in UTF-8 mode, is not supported in UTF-8 mode, because the  single data unit, even in UTF-8 or UTF-16 modes, is not supported in these
171  alternative algorithm moves through the subject string one character at a time,  modes, because the alternative algorithm moves through the subject string one
172  for all active paths through the tree.  character (not data unit) at a time, for all active paths through the tree.
173  </P>  </P>
174  <P>  <P>
175  8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not  8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not
# Line 184  callouts. Line 187  callouts.
187  </P>  </P>
188  <P>  <P>
189  2. Because the alternative algorithm scans the subject string just once, and  2. Because the alternative algorithm scans the subject string just once, and
190  never needs to backtrack, it is possible to pass very long subject strings to  never needs to backtrack (except for lookbehinds), it is possible to pass very
191  the matching function in several pieces, checking for partial matching each  long subject strings to the matching function in several pieces, checking for
192  time. Although it is possible to do multi-segment matching using the standard  partial matching each time. Although it is possible to do multi-segment
193  algorithm (<b>pcre_exec()</b>), by retaining partially matched substrings, it is  matching using the standard algorithm by retaining partially matched
194  more complicated. The  substrings, it is more complicated. The
195  <a href="pcrepartial.html"><b>pcrepartial</b></a>  <a href="pcrepartial.html"><b>pcrepartial</b></a>
196  documentation gives details of partial matching and discusses multi-segment  documentation gives details of partial matching and discusses multi-segment
197  matching.  matching.
# Line 220  Cambridge CB2 3QH, England. Line 223  Cambridge CB2 3QH, England.
223  </P>  </P>
224  <br><a name="SEC8" href="#TOC1">REVISION</a><br>  <br><a name="SEC8" href="#TOC1">REVISION</a><br>
225  <P>  <P>
226  Last updated: 19 November 2011  Last updated: 08 January 2012
227  <br>  <br>
228  Copyright &copy; 1997-2010 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
229  <br>  <br>
230  <p>  <p>
231  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.868  
changed lines
  Added in v.869

  ViewVC Help
Powered by ViewVC 1.1.5