10 |
.P |
.P |
11 |
1. PCRE has only a subset of Perl's UTF-8 and Unicode support. Details of what |
1. PCRE has only a subset of Perl's UTF-8 and Unicode support. Details of what |
12 |
it does have are given in the |
it does have are given in the |
|
.\" HTML <a href="pcre.html#utf8support"> |
|
|
.\" </a> |
|
|
section on UTF-8 support |
|
|
.\" |
|
|
in the main |
|
13 |
.\" HREF |
.\" HREF |
14 |
\fBpcre\fP |
\fBpcreunicode\fP |
15 |
.\" |
.\" |
16 |
page. |
page. |
17 |
.P |
.P |
79 |
.\" |
.\" |
80 |
documentation for details. |
documentation for details. |
81 |
.P |
.P |
82 |
10. Subpatterns that are called recursively or as "subroutines" are always |
10. Subpatterns that are called as subroutines (whether or not recursively) are |
83 |
treated as atomic groups in PCRE. This is like Python, but unlike Perl. There |
always treated as atomic groups in PCRE. This is like Python, but unlike Perl. |
84 |
is a discussion of an example that explains this in more detail in the |
Captured values that are set outside a subroutine call can be reference from |
85 |
|
inside in PCRE, but not in Perl. There is a discussion that explains these |
86 |
|
differences in more detail in the |
87 |
.\" HTML <a href="pcrepattern.html#recursiondifference"> |
.\" HTML <a href="pcrepattern.html#recursiondifference"> |
88 |
.\" </a> |
.\" </a> |
89 |
section on recursion differences from Perl |
section on recursion differences from Perl |
94 |
.\" |
.\" |
95 |
page. |
page. |
96 |
.P |
.P |
97 |
11. There are some differences that are concerned with the settings of captured |
11. If (*THEN) is present in a group that is called as a subroutine, its action |
98 |
|
is limited to that group, even if the group does not contain any | characters. |
99 |
|
.P |
100 |
|
12. There are some differences that are concerned with the settings of captured |
101 |
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 |
102 |
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". |
103 |
.P |
.P |
104 |
12. PCRE's handling of duplicate subpattern numbers and duplicate subpattern |
13. PCRE's handling of duplicate subpattern numbers and duplicate subpattern |
105 |
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 |
106 |
works internally just with numbers, using an external table to translate |
works internally just with numbers, using an external table to translate |
107 |
between numbers and names. In particular, a pattern such as (?|(?<a>A)|(?<b)B), |
between numbers and names. In particular, a pattern such as (?|(?<a>A)|(?<b)B), |
111 |
names map to capturing subpattern number 1. To avoid this confusing situation, |
names map to capturing subpattern number 1. To avoid this confusing situation, |
112 |
an error is given at compile time. |
an error is given at compile time. |
113 |
.P |
.P |
114 |
13. Perl recognizes comments in some places that PCRE does not, for example, |
14. Perl recognizes comments in some places that PCRE does not, for example, |
115 |
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, |
116 |
Perl allows whitespace between ( and ? but PCRE never does, even if the |
Perl allows whitespace between ( and ? but PCRE never does, even if the |
117 |
PCRE_EXTENDED option is set. |
PCRE_EXTENDED option is set. |
118 |
.P |
.P |
119 |
14. PCRE provides some extensions to the Perl regular expression facilities. |
15. PCRE provides some extensions to the Perl regular expression facilities. |
120 |
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 |
121 |
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 |
122 |
is with respect to Perl 5.10: |
is with respect to Perl 5.10: |
150 |
(i) The partial matching facility is PCRE-specific. |
(i) The partial matching facility is PCRE-specific. |
151 |
.sp |
.sp |
152 |
(j) Patterns compiled by PCRE can be saved and re-used at a later time, even on |
(j) Patterns compiled by PCRE can be saved and re-used at a later time, even on |
153 |
different hosts that have the other endianness. |
different hosts that have the other endianness. However, this does not apply to |
154 |
|
optimized data created by the just-in-time compiler. |
155 |
.sp |
.sp |
156 |
(k) The alternative matching function (\fBpcre_dfa_exec()\fP) matches in a |
(k) The alternative matching function (\fBpcre_dfa_exec()\fP) matches in a |
157 |
different way and is not Perl-compatible. |
different way and is not Perl-compatible. |
174 |
.rs |
.rs |
175 |
.sp |
.sp |
176 |
.nf |
.nf |
177 |
Last updated: 24 July 2011 |
Last updated: 09 October 2011 |
178 |
Copyright (c) 1997-2011 University of Cambridge. |
Copyright (c) 1997-2011 University of Cambridge. |
179 |
.fi |
.fi |