/[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 1297 by ph10, Tue Mar 19 17:28:25 2013 UTC revision 1298 by ph10, Fri Mar 22 16:13:13 2013 UTC
# Line 1  Line 1 
1  .TH PCREPATTERN 3 "19 March 2013" "PCRE 8.33"  .TH PCREPATTERN 3 "22 March 2013" "PCRE 8.33"
2  .SH NAME  .SH NAME
3  PCRE - Perl-compatible regular expressions  PCRE - Perl-compatible regular expressions
4  .SH "PCRE REGULAR EXPRESSION DETAILS"  .SH "PCRE REGULAR EXPRESSION DETAILS"
# Line 2688  exception of (*FAIL), which behaves like Line 2688  exception of (*FAIL), which behaves like
2688  backtracking control verbs cause an error if encountered by a DFA matching  backtracking control verbs cause an error if encountered by a DFA matching
2689  function.  function.
2690  .P  .P
2691  If any of these verbs are used in a subpattern that is called as a subroutine  The behaviour of these verbs in
2692  (whether or not recursively), their effect is confined to that subpattern; it  .\" HTML <a href="#btrepeat">
2693  does not extend to the surrounding pattern. (This is the same as for capturing  .\" </a>
2694  parentheses in subroutines.) Note that such subpatterns are processed as  repeated groups,
2695  anchored at the point where they are tested. Note also that Perl's treatment of  .\"
2696  subroutines is different in some cases.  .\" HTML <a href="#btassert">
2697  .P  .\" </a>
2698  By contrast, if any of these verbs are used in an assertion, they have their  assertions,
2699  normal action. Again, Perl's treatment differs in some cases.  .\"
2700    and in
2701    .\" HTML <a href="#btsub">
2702    .\" </a>
2703    subpatterns called as subroutines
2704    .\"
2705    (whether or not recursively) is documented below.
2706  .  .
2707  .  .
2708  .\" HTML <a name="nooptimize"></a>  .\" HTML <a name="nooptimize"></a>
# Line 3010  it to be triggered, and its action is ta Line 3016  it to be triggered, and its action is ta
3016  onto (*COMMIT).  onto (*COMMIT).
3017  .  .
3018  .  .
3019    .\" HTML <a name="btrepeat"></a>
3020  .SS "Backtracking verbs in repeated groups"  .SS "Backtracking verbs in repeated groups"
3021  .rs  .rs
3022  .sp  .sp
# Line 3022  If the subject is "abac", Perl matches, Line 3029  If the subject is "abac", Perl matches,
3029  the second repeat of the group acts.  the second repeat of the group acts.
3030  .  .
3031  .  .
3032    .\" HTML <a name="btassert"></a>
3033    .SS "Backtracking verbs in assertions"
3034    .rs
3035    .sp
3036    (*FAIL) in an assertion has its normal effect: it forces an immediate backtrack.
3037    .P
3038    (*ACCEPT) in a positive assertion causes the assertion to succeed without any
3039    further processing. In a negative assertion, (*ACCEPT) causes the assertion to
3040    fail without any further processing.
3041    .P
3042    The other backtracking verbs are not treated specially if they appear in an
3043    assertion. In particular, (*THEN) skips to the next alternative in the
3044    innermost enclosing group that has alternations, whether or not this is within
3045    the assertion.
3046    .
3047    .
3048    .\" HTML <a name="btsub"></a>
3049    .SS "Backtracking verbs in subroutines"
3050    .rs
3051    .sp
3052    These behaviours occur whether or not the subpattern is called recursively.
3053    Perl's treatment of subroutines is different in some cases.
3054    .P
3055    (*FAIL) in a subpattern called as a subroutine has its normal effect: it forces
3056    an immediate backtrack.
3057    .P
3058    (*ACCEPT) in a subpattern called as a subroutine causes the subroutine match to
3059    succeed without any further processing. Matching then continues after the
3060    subroutine call.
3061    .P
3062    (*COMMIT), (*SKIP), and (*PRUNE) in a subpattern called as a subroutine cause
3063    the subroutine match to fail.
3064    .P
3065    (*THEN) skips to the next alternative in the innermost enclosing group within
3066    the subpattern that has alternatives. If there is no such group within the
3067    subpattern, (*THEN) causes the subroutine match to fail.
3068    .
3069    .
3070  .SH "SEE ALSO"  .SH "SEE ALSO"
3071  .rs  .rs
3072  .sp  .sp
# Line 3043  Cambridge CB2 3QH, England. Line 3088  Cambridge CB2 3QH, England.
3088  .rs  .rs
3089  .sp  .sp
3090  .nf  .nf
3091  Last updated: 19 March 2013  Last updated: 22 March 2013
3092  Copyright (c) 1997-2013 University of Cambridge.  Copyright (c) 1997-2013 University of Cambridge.
3093  .fi  .fi

Legend:
Removed from v.1297  
changed lines
  Added in v.1298

  ViewVC Help
Powered by ViewVC 1.1.5