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

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

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

revision 550 by ph10, Sun Oct 10 16:24:11 2010 UTC revision 551 by ph10, Sun Oct 10 17:33:07 2010 UTC
# Line 2644  behaviour of (*THEN:NAME) is exactly the Line 2644  behaviour of (*THEN:NAME) is exactly the
2644  overall match fails. If (*THEN) is not directly inside an alternation, it acts  overall match fails. If (*THEN) is not directly inside an alternation, it acts
2645  like (*PRUNE).  like (*PRUNE).
2646  .  .
2647    .P
2648    The above verbs provide four different "strengths" of control when subsequent
2649    matching fails. (*THEN) is the weakest, carrying on the match at the next
2650    alternation. (*PRUNE) comes next, failing the match at the current starting
2651    position, but allowing an advance to the next character (for an unanchored
2652    pattern). (*SKIP) is similar, except that the advance may be more than one
2653    character. (*COMMIT) is the strongest, causing the entire match to fail.
2654    .P
2655    If more than one is present in a pattern, the "stongest" one wins. For example,
2656    consider this pattern, where A, B, etc. are complex pattern fragments:
2657    .sp
2658      (A(*COMMIT)B(*THEN)C|D)
2659    .sp
2660    Once A has matched, PCRE is committed to this match, at the current starting
2661    position. If subsequently B matches, but C does not, the normal (*THEN) action
2662    of trying the next alternation (that is, D) does not happen because (*COMMIT)
2663    overrides.
2664    .
2665  .  .
2666  .SH "SEE ALSO"  .SH "SEE ALSO"
2667  .rs  .rs

Legend:
Removed from v.550  
changed lines
  Added in v.551

  ViewVC Help
Powered by ViewVC 1.1.5