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

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

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

revision 1193 by ph10, Sat Jun 2 11:03:06 2012 UTC revision 1194 by ph10, Wed Oct 31 17:42:29 2012 UTC
# Line 14  man page, in case the conversion went wr Line 14  man page, in case the conversion went wr
14  <br>  <br>
15  <ul>  <ul>
16  <li><a name="TOC1" href="#SEC1">PARTIAL MATCHING IN PCRE</a>  <li><a name="TOC1" href="#SEC1">PARTIAL MATCHING IN PCRE</a>
17  <li><a name="TOC2" href="#SEC2">PARTIAL MATCHING USING pcre_exec() OR pcre16_exec()</a>  <li><a name="TOC2" href="#SEC2">PARTIAL MATCHING USING pcre_exec() OR pcre[16|32]_exec()</a>
18  <li><a name="TOC3" href="#SEC3">PARTIAL MATCHING USING pcre_dfa_exec() OR pcre16_dfa_exec()</a>  <li><a name="TOC3" href="#SEC3">PARTIAL MATCHING USING pcre_dfa_exec() OR pcre[16|32]_dfa_exec()</a>
19  <li><a name="TOC4" href="#SEC4">PARTIAL MATCHING AND WORD BOUNDARIES</a>  <li><a name="TOC4" href="#SEC4">PARTIAL MATCHING AND WORD BOUNDARIES</a>
20  <li><a name="TOC5" href="#SEC5">FORMERLY RESTRICTED PATTERNS</a>  <li><a name="TOC5" href="#SEC5">FORMERLY RESTRICTED PATTERNS</a>
21  <li><a name="TOC6" href="#SEC6">EXAMPLE OF PARTIAL MATCHING USING PCRETEST</a>  <li><a name="TOC6" href="#SEC6">EXAMPLE OF PARTIAL MATCHING USING PCRETEST</a>
22  <li><a name="TOC7" href="#SEC7">MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre16_dfa_exec()</a>  <li><a name="TOC7" href="#SEC7">MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre[16|32]_dfa_exec()</a>
23  <li><a name="TOC8" href="#SEC8">MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre16_exec()</a>  <li><a name="TOC8" href="#SEC8">MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre[16|32]_exec()</a>
24  <li><a name="TOC9" href="#SEC9">ISSUES WITH MULTI-SEGMENT MATCHING</a>  <li><a name="TOC9" href="#SEC9">ISSUES WITH MULTI-SEGMENT MATCHING</a>
25  <li><a name="TOC10" href="#SEC10">AUTHOR</a>  <li><a name="TOC10" href="#SEC10">AUTHOR</a>
26  <li><a name="TOC11" href="#SEC11">REVISION</a>  <li><a name="TOC11" href="#SEC11">REVISION</a>
# Line 59  are set, PCRE_PARTIAL_HARD takes precede Line 59  are set, PCRE_PARTIAL_HARD takes precede
59  </P>  </P>
60  <P>  <P>
61  If you want to use partial matching with just-in-time optimized code, you must  If you want to use partial matching with just-in-time optimized code, you must
62  call <b>pcre_study()</b> or <b>pcre16_study()</b> with one or both of these  call <b>pcre_study()</b>, <b>pcre16_study()</b> or  <b>pcre32_study()</b> with one
63  options:  or both of these options:
64  <pre>  <pre>
65    PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE    PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE
66    PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE    PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
# Line 78  partially. If the pattern was studied, P Line 78  partially. If the pattern was studied, P
78  matching string, and does not bother to run the matching function on shorter  matching string, and does not bother to run the matching function on shorter
79  strings. This optimization is also disabled for partial matching.  strings. This optimization is also disabled for partial matching.
80  </P>  </P>
81  <br><a name="SEC2" href="#TOC1">PARTIAL MATCHING USING pcre_exec() OR pcre16_exec()</a><br>  <br><a name="SEC2" href="#TOC1">PARTIAL MATCHING USING pcre_exec() OR pcre[16|32]_exec()</a><br>
82  <P>  <P>
83  A partial match occurs during a call to <b>pcre_exec()</b> or  A partial match occurs during a call to <b>pcre_exec()</b> or
84  <b>pcre16_exec()</b> when the end of the subject string is reached successfully,  <b>pcre[16|32]_exec()</b> when the end of the subject string is reached successfully,
85  but matching cannot continue because more characters are needed. However, at  but matching cannot continue because more characters are needed. However, at
86  least one character in the subject must have been inspected. This character  least one character in the subject must have been inspected. This character
87  need not form part of the final matched string; lookbehind assertions and the  need not form part of the final matched string; lookbehind assertions and the
# Line 114  What happens when a partial match is ide Line 114  What happens when a partial match is ide
114  partial matching options are set.  partial matching options are set.
115  </P>  </P>
116  <br><b>  <br><b>
117  PCRE_PARTIAL_SOFT WITH pcre_exec() OR pcre16_exec()  PCRE_PARTIAL_SOFT WITH pcre_exec() OR pcre[16|32]_exec()
118  </b><br>  </b><br>
119  <P>  <P>
120  If PCRE_PARTIAL_SOFT is set when <b>pcre_exec()</b> or <b>pcre16_exec()</b>  If PCRE_PARTIAL_SOFT is set when <b>pcre_exec()</b> or <b>pcre[16|32]_exec()</b>
121  identifies a partial match, the partial match is remembered, but matching  identifies a partial match, the partial match is remembered, but matching
122  continues as normal, and other alternatives in the pattern are tried. If no  continues as normal, and other alternatives in the pattern are tried. If no
123  complete match can be found, PCRE_ERROR_PARTIAL is returned instead of  complete match can be found, PCRE_ERROR_PARTIAL is returned instead of
# Line 144  example, there are two partial matches, Line 144  example, there are two partial matches,
144  matches the second alternative.)  matches the second alternative.)
145  </P>  </P>
146  <br><b>  <br><b>
147  PCRE_PARTIAL_HARD WITH pcre_exec() OR pcre16_exec()  PCRE_PARTIAL_HARD WITH pcre_exec() OR pcre[16|32]_exec()
148  </b><br>  </b><br>
149  <P>  <P>
150  If PCRE_PARTIAL_HARD is set for <b>pcre_exec()</b> or <b>pcre16_exec()</b>,  If PCRE_PARTIAL_HARD is set for <b>pcre_exec()</b> or <b>pcre[16|32]_exec()</b>,
151  PCRE_ERROR_PARTIAL is returned as soon as a partial match is found, without  PCRE_ERROR_PARTIAL is returned as soon as a partial match is found, without
152  continuing to search for possible complete matches. This option is "hard"  continuing to search for possible complete matches. This option is "hard"
153  because it prefers an earlier partial match over a later complete match. For  because it prefers an earlier partial match over a later complete match. For
# Line 192  to follow this explanation by thinking o Line 192  to follow this explanation by thinking o
192  The second pattern will never match "dogsbody", because it will always find the  The second pattern will never match "dogsbody", because it will always find the
193  shorter match first.  shorter match first.
194  </P>  </P>
195  <br><a name="SEC3" href="#TOC1">PARTIAL MATCHING USING pcre_dfa_exec() OR pcre16_dfa_exec()</a><br>  <br><a name="SEC3" href="#TOC1">PARTIAL MATCHING USING pcre_dfa_exec() OR pcre[16|32]_dfa_exec()</a><br>
196  <P>  <P>
197  The DFA functions move along the subject string character by character, without  The DFA functions move along the subject string character by character, without
198  backtracking, searching for all possible matches simultaneously. If the end of  backtracking, searching for all possible matches simultaneously. If the end of
# Line 280  if DFA matching is used. Line 280  if DFA matching is used.
280  If the escape sequence \P is present more than once in a <b>pcretest</b> data  If the escape sequence \P is present more than once in a <b>pcretest</b> data
281  line, the PCRE_PARTIAL_HARD option is set for the match.  line, the PCRE_PARTIAL_HARD option is set for the match.
282  </P>  </P>
283  <br><a name="SEC7" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre16_dfa_exec()</a><br>  <br><a name="SEC7" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre[16|32]_dfa_exec()</a><br>
284  <P>  <P>
285  When a partial match has been found using a DFA matching function, it is  When a partial match has been found using a DFA matching function, it is
286  possible to continue the match by providing additional subject data and calling  possible to continue the match by providing additional subject data and calling
# Line 308  PCRE_DFA_RESTART to continue partial mat Line 308  PCRE_DFA_RESTART to continue partial mat
308  facility can be used to pass very long subject strings to the DFA matching  facility can be used to pass very long subject strings to the DFA matching
309  functions.  functions.
310  </P>  </P>
311  <br><a name="SEC8" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre16_exec()</a><br>  <br><a name="SEC8" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre[16|32]_exec()</a><br>
312  <P>  <P>
313  From release 8.00, the standard matching functions can also be used to do  From release 8.00, the standard matching functions can also be used to do
314  multi-segment matching. Unlike the DFA functions, it is not possible to  multi-segment matching. Unlike the DFA functions, it is not possible to
# Line 356  includes the effect of PCRE_NOTEOL. Line 356  includes the effect of PCRE_NOTEOL.
356  offsets that are returned for a partial match. However a lookbehind assertion  offsets that are returned for a partial match. However a lookbehind assertion
357  later in the pattern could require even earlier characters to be inspected. You  later in the pattern could require even earlier characters to be inspected. You
358  can handle this case by using the PCRE_INFO_MAXLOOKBEHIND option of the  can handle this case by using the PCRE_INFO_MAXLOOKBEHIND option of the
359  <b>pcre_fullinfo()</b> or <b>pcre16_fullinfo()</b> functions to obtain the length  <b>pcre_fullinfo()</b> or <b>pcre[16|32]_fullinfo()</b> functions to obtain the length
360  of the largest lookbehind in the pattern. This length is given in characters,  of the largest lookbehind in the pattern. This length is given in characters,
361  not bytes. If you always retain at least that many characters before the  not bytes. If you always retain at least that many characters before the
362  partially matched string, all should be well. (Of course, near the start of the  partially matched string, all should be well. (Of course, near the start of the
# Line 465  Cambridge CB2 3QH, England. Line 465  Cambridge CB2 3QH, England.
465  </P>  </P>
466  <br><a name="SEC11" href="#TOC1">REVISION</a><br>  <br><a name="SEC11" href="#TOC1">REVISION</a><br>
467  <P>  <P>
468  Last updated: 24 February 2012  Last updated: 24 June 2012
469  <br>  <br>
470  Copyright &copy; 1997-2012 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
471  <br>  <br>

Legend:
Removed from v.1193  
changed lines
  Added in v.1194

  ViewVC Help
Powered by ViewVC 1.1.5