/[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 1193 by ph10, Sat Jun 2 11:03:06 2012 UTC revision 1194 by ph10, Wed Oct 31 17:42:29 2012 UTC
# Line 67  the internal representation of Unicode c Line 67  the internal representation of Unicode c
67  implement the somewhat messy concept of surrogates."  implement the somewhat messy concept of surrogates."
68  </P>  </P>
69  <P>  <P>
70  7. PCRE implements a simpler version of \X than Perl, which changed to make  7. PCRE does support the \Q...\E escape for quoting substrings. Characters in
 \X match what Unicode calls an "extended grapheme cluster". This is more  
 complicated than an extended Unicode sequence, which is what PCRE matches.  
 </P>  
 <P>  
 8. PCRE does support the \Q...\E escape for quoting substrings. Characters in  
71  between are treated as literals. This is slightly different from Perl in that $  between are treated as literals. This is slightly different from Perl in that $
72  and @ are also handled as literals inside the quotes. In Perl, they cause  and @ are also handled as literals inside the quotes. In Perl, they cause
73  variable interpolation (but of course PCRE does not have variables). Note the  variable interpolation (but of course PCRE does not have variables). Note the
# Line 87  following examples: Line 82  following examples:
82  The \Q...\E sequence is recognized both inside and outside character classes.  The \Q...\E sequence is recognized both inside and outside character classes.
83  </P>  </P>
84  <P>  <P>
85  9. Fairly obviously, PCRE does not support the (?{code}) and (??{code})  8. Fairly obviously, PCRE does not support the (?{code}) and (??{code})
86  constructions. However, there is support for recursive patterns. This is not  constructions. However, there is support for recursive patterns. This is not
87  available in Perl 5.8, but it is in Perl 5.10. Also, the PCRE "callout"  available in Perl 5.8, but it is in Perl 5.10. Also, the PCRE "callout"
88  feature allows an external function to be called during pattern matching. See  feature allows an external function to be called during pattern matching. See
# Line 96  the Line 91  the
91  documentation for details.  documentation for details.
92  </P>  </P>
93  <P>  <P>
94  10. Subpatterns that are called as subroutines (whether or not recursively) are  9. Subpatterns that are called as subroutines (whether or not recursively) are
95  always treated as atomic groups in PCRE. This is like Python, but unlike Perl.  always treated as atomic groups in PCRE. This is like Python, but unlike Perl.
96  Captured values that are set outside a subroutine call can be reference from  Captured values that are set outside a subroutine call can be reference from
97  inside in PCRE, but not in Perl. There is a discussion that explains these  inside in PCRE, but not in Perl. There is a discussion that explains these
# Line 107  in the Line 102  in the
102  page.  page.
103  </P>  </P>
104  <P>  <P>
105  11. 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 an assertion or in a
106  subpattern that is called as a subroutine (whether or not recursively), their  subpattern that is called as a subroutine (whether or not recursively), their
107  effect is confined to that subpattern; it does not extend to the surrounding  effect is confined to that subpattern; it does not extend to the surrounding
108  pattern. This is not always the case in Perl. In particular, if (*THEN) is  pattern. This is not always the case in Perl. In particular, if (*THEN) is
# Line 119  match succeeds (compare capturing parent Line 114  match succeeds (compare capturing parent
114  subpatterns are processed as anchored at the point where they are tested.  subpatterns are processed as anchored at the point where they are tested.
115  </P>  </P>
116  <P>  <P>
117  12. There are some differences that are concerned with the settings of captured  11. There are some differences that are concerned with the settings of captured
118  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
119  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".
120  </P>  </P>
121  <P>  <P>
122  13. PCRE's handling of duplicate subpattern numbers and duplicate subpattern  12. PCRE's handling of duplicate subpattern numbers and duplicate subpattern
123  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
124  works internally just with numbers, using an external table to translate  works internally just with numbers, using an external table to translate
125  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 135  names map to capturing subpattern number Line 130  names map to capturing subpattern number
130  an error is given at compile time.  an error is given at compile time.
131  </P>  </P>
132  <P>  <P>
133  14. Perl recognizes comments in some places that PCRE does not, for example,  13. Perl recognizes comments in some places that PCRE does not, for example,
134  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,
135  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
136  PCRE_EXTENDED option is set.  PCRE_EXTENDED option is set.
137  </P>  </P>
138  <P>  <P>
139  15. PCRE provides some extensions to the Perl regular expression facilities.  14. PCRE provides some extensions to the Perl regular expression facilities.
140  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
141  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
142  is with respect to Perl 5.10:  is with respect to Perl 5.10:
# Line 189  different hosts that have the other endi Line 184  different hosts that have the other endi
184  optimized data created by the just-in-time compiler.  optimized data created by the just-in-time compiler.
185  <br>  <br>
186  <br>  <br>
187  (k) The alternative matching functions (<b>pcre_dfa_exec()</b> and  (k) The alternative matching functions (<b>pcre_dfa_exec()</b>,
188  <b>pcre16_dfa_exec()</b>) match in a different way and are not Perl-compatible.  <b>pcre16_dfa_exec()</b> and <b>pcre32_dfa_exec()</b>,) match in a different way
189    and are not Perl-compatible.
190  <br>  <br>
191  <br>  <br>
192  (l) PCRE recognizes some special sequences such as (*CR) at the start of  (l) PCRE recognizes some special sequences such as (*CR) at the start of
# Line 211  Cambridge CB2 3QH, England. Line 207  Cambridge CB2 3QH, England.
207  REVISION  REVISION
208  </b><br>  </b><br>
209  <P>  <P>
210  Last updated: 01 June 2012  Last updated: 25 August 2012
211  <br>  <br>
212  Copyright &copy; 1997-2012 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
213  <br>  <br>

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

  ViewVC Help
Powered by ViewVC 1.1.5