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

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

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

revision 1297 by ph10, Wed Oct 31 17:42:29 2012 UTC revision 1298 by ph10, Fri Mar 22 16:13:13 2013 UTC
# Line 36  these do not seem to have any use. Line 36  these do not seem to have any use.
36  </P>  </P>
37  <P>  <P>
38  3. Capturing subpatterns that occur inside negative lookahead assertions are  3. Capturing subpatterns that occur inside negative lookahead assertions are
39  counted, but their entries in the offsets vector are never set. Perl sets its  counted, but their entries in the offsets vector are never set. Perl sometimes
40  numerical variables from any such patterns that are matched before the  (but not always) sets its numerical variables from inside negative assertions.
 assertion fails to match something (thereby succeeding), but only if the  
 negative lookahead assertion contains just one branch.  
41  </P>  </P>
42  <P>  <P>
43  4. Though binary zero characters are supported in the subject string, they are  4. Though binary zero characters are supported in the subject string, they are
# Line 102  in the Line 100  in the
100  page.  page.
101  </P>  </P>
102  <P>  <P>
103  10. If any of the backtracking control verbs are used in an assertion or in a  10. If any of the backtracking control verbs are used in a subpattern that is
104  subpattern that is called as a subroutine (whether or not recursively), their  called as a subroutine (whether or not recursively), their effect is confined
105  effect is confined to that subpattern; it does not extend to the surrounding  to that subpattern; it does not extend to the surrounding pattern. This is not
106  pattern. This is not always the case in Perl. In particular, if (*THEN) is  always the case in Perl. In particular, if (*THEN) is present in a group that
107  present in a group that is called as a subroutine, its action is limited to  is called as a subroutine, its action is limited to that group, even if the
108  that group, even if the group does not contain any | characters. There is one  group does not contain any | characters. Note that such subpatterns are
109  exception to this: the name from a *(MARK), (*PRUNE), or (*THEN) that is  processed as anchored at the point where they are tested.
 encountered in a successful positive assertion <i>is</i> passed back when a  
 match succeeds (compare capturing parentheses in assertions). Note that such  
 subpatterns are processed as anchored at the point where they are tested.  
110  </P>  </P>
111  <P>  <P>
112  11. There are some differences that are concerned with the settings of captured  11. If a pattern contains more than one backtracking control verb, the first
113    one that is backtracked onto acts. For example, in the pattern
114    A(*COMMIT)B(*PRUNE)C a failure in B triggers (*COMMIT), but a failure in C
115    triggers (*PRUNE). Perl's behaviour is more complex; in many cases it is the
116    same as PCRE, but there are examples where it differs.
117    </P>
118    <P>
119    12. Most backtracking verbs in assertions have their normal actions. They are
120    not confined to the assertion.
121    </P>
122    <P>
123    13. There are some differences that are concerned with the settings of captured
124  strings when part of a pattern is repeated. For example, matching "aba" against  strings when part of a pattern is repeated. For example, matching "aba" against
125  the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b".  the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b".
126  </P>  </P>
127  <P>  <P>
128  12. PCRE's handling of duplicate subpattern numbers and duplicate subpattern  14. PCRE's handling of duplicate subpattern numbers and duplicate subpattern
129  names is not as general as Perl's. This is a consequence of the fact the PCRE  names is not as general as Perl's. This is a consequence of the fact the PCRE
130  works internally just with numbers, using an external table to translate  works internally just with numbers, using an external table to translate
131  between numbers and names. In particular, a pattern such as (?|(?&#60;a&#62;A)|(?&#60;b)B),  between numbers and names. In particular, a pattern such as (?|(?&#60;a&#62;A)|(?&#60;b)B),
# Line 130  names map to capturing subpattern number Line 136  names map to capturing subpattern number
136  an error is given at compile time.  an error is given at compile time.
137  </P>  </P>
138  <P>  <P>
139  13. Perl recognizes comments in some places that PCRE does not, for example,  15. Perl recognizes comments in some places that PCRE does not, for example,
140  between the ( and ? at the start of a subpattern. If the /x modifier is set,  between the ( and ? at the start of a subpattern. If the /x modifier is set,
141  Perl allows white space between ( and ? but PCRE never does, even if the  Perl allows white space between ( and ? but PCRE never does, even if the
142  PCRE_EXTENDED option is set.  PCRE_EXTENDED option is set.
143  </P>  </P>
144  <P>  <P>
145  14. PCRE provides some extensions to the Perl regular expression facilities.  16. In PCRE, the upper/lower case character properties Lu and Ll are not
146    affected when case-independent matching is specified. For example, \p{Lu}
147    always matches an upper case letter. I think Perl has changed in this respect;
148    in the release at the time of writing (5.16), \p{Lu} and \p{Ll} match all
149    letters, regardless of case, when case independence is specified.
150    </P>
151    <P>
152    17. PCRE provides some extensions to the Perl regular expression facilities.
153  Perl 5.10 includes new features that are not in earlier versions of Perl, some  Perl 5.10 includes new features that are not in earlier versions of Perl, some
154  of which (such as named parentheses) have been in PCRE for some time. This list  of which (such as named parentheses) have been in PCRE for some time. This list
155  is with respect to Perl 5.10:  is with respect to Perl 5.10:
# Line 207  Cambridge CB2 3QH, England. Line 220  Cambridge CB2 3QH, England.
220  REVISION  REVISION
221  </b><br>  </b><br>
222  <P>  <P>
223  Last updated: 25 August 2012  Last updated: 19 March 2013
224  <br>  <br>
225  Copyright &copy; 1997-2012 University of Cambridge.  Copyright &copy; 1997-2013 University of Cambridge.
226  <br>  <br>
227  <p>  <p>
228  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.1297  
changed lines
  Added in v.1298

  ViewVC Help
Powered by ViewVC 1.1.5