| 1 |
ChangeLog for PCRE |
ChangeLog for PCRE |
| 2 |
------------------ |
------------------ |
| 3 |
|
|
| 4 |
Version 8.13 30-Apr-2011 |
Version 8.13 02-Aug-2011 |
| 5 |
------------------------ |
------------------------ |
| 6 |
|
|
| 7 |
1. The Unicode data tables have been updated to Unicode 6.0.0. |
1. The Unicode data tables have been updated to Unicode 6.0.0. |
| 95 |
|
|
| 96 |
17. There was optimizing code for the last branch of non-capturing parentheses, |
17. There was optimizing code for the last branch of non-capturing parentheses, |
| 97 |
and also for the obeyed branch of a conditional subexpression, which used |
and also for the obeyed branch of a conditional subexpression, which used |
| 98 |
tail recursion to cut down on stack usage. Unfortunately, not that there is |
tail recursion to cut down on stack usage. Unfortunately, now that there is |
| 99 |
the possibility of (*THEN) occurring in these branches, tail recursion is |
the possibility of (*THEN) occurring in these branches, tail recursion is |
| 100 |
no longer possible because the return has to be checked for (*THEN). These |
no longer possible because the return has to be checked for (*THEN). These |
| 101 |
two optimizations have therefore been removed. |
two optimizations have therefore been removed. |
| 107 |
19. If a pattern containing (*ACCEPT) was studied, the minimum subject length |
19. If a pattern containing (*ACCEPT) was studied, the minimum subject length |
| 108 |
was incorrectly computed. |
was incorrectly computed. |
| 109 |
|
|
| 110 |
20. If /S is present twice on a test pattern in pcretest input, it *disables* |
20. If /S is present twice on a test pattern in pcretest input, it now |
| 111 |
studying, thereby overriding the use of -s on the command line. This is |
*disables* studying, thereby overriding the use of -s on the command line |
| 112 |
necessary for one or two tests to keep the output identical in both cases. |
(see 14 above). This is necessary for one or two tests to keep the output |
| 113 |
|
identical in both cases. |
| 114 |
|
|
| 115 |
21. When (*ACCEPT) was used in an assertion that matched an empty string and |
21. When (*ACCEPT) was used in an assertion that matched an empty string and |
| 116 |
PCRE_NOTEMPTY was set, PCRE applied the non-empty test to the assertion. |
PCRE_NOTEMPTY was set, PCRE applied the non-empty test to the assertion. |
| 121 |
captured. For example, /(?>(a))b|(a)c/ when matching "ac" set capturing |
captured. For example, /(?>(a))b|(a)c/ when matching "ac" set capturing |
| 122 |
group 1 to "a", when in fact it should be unset. This applied to multi- |
group 1 to "a", when in fact it should be unset. This applied to multi- |
| 123 |
branched capturing and non-capturing groups, repeated or not, and also to |
branched capturing and non-capturing groups, repeated or not, and also to |
| 124 |
positive assertions (capturing in negative assertions is not well defined |
positive assertions (capturing in negative assertions does not happen |
| 125 |
in PCRE) and also to nested atomic groups. |
in PCRE) and also to nested atomic groups. |
| 126 |
|
|
| 127 |
23. Add the ++ qualifier feature to pcretest, to show the remainder of the |
23. Add the ++ qualifier feature to pcretest, to show the remainder of the |
| 128 |
subject after a captured substring (to make it easier to tell which of a |
subject after a captured substring, to make it easier to tell which of a |
| 129 |
number of identical substrings has been captured). |
number of identical substrings has been captured. |
| 130 |
|
|
| 131 |
24. The way atomic groups are processed by pcre_exec() has been changed so that |
24. The way atomic groups are processed by pcre_exec() has been changed so that |
| 132 |
if they are repeated, backtracking one repetition now resets captured |
if they are repeated, backtracking one repetition now resets captured |
| 135 |
"aaa". Previously, it would have been "a". As part of this code |
"aaa". Previously, it would have been "a". As part of this code |
| 136 |
refactoring, the way recursive calls are handled has also been changed. |
refactoring, the way recursive calls are handled has also been changed. |
| 137 |
|
|
| 138 |
24. If an assertion condition captured any substrings, they were not passed |
25. If an assertion condition captured any substrings, they were not passed |
| 139 |
back unless some other capturing happened later. For example, if |
back unless some other capturing happened later. For example, if |
| 140 |
(?(?=(a))a) was matched against "a", no capturing was returned. |
(?(?=(a))a) was matched against "a", no capturing was returned. |
| 141 |
|
|
| 142 |
25. When studying a pattern that contained subroutine calls or assertions, |
26. When studying a pattern that contained subroutine calls or assertions, |
| 143 |
the code for finding the minimum length of a possible match was handling |
the code for finding the minimum length of a possible match was handling |
| 144 |
direct recursions such as (xxx(?1)|yyy) but not mutual recursions (where |
direct recursions such as (xxx(?1)|yyy) but not mutual recursions (where |
| 145 |
group 1 called group 2 while simultaneously a separate group 2 called group |
group 1 called group 2 while simultaneously a separate group 2 called group |
| 146 |
1). A stack overflow occurred in this case. I have fixed this by limiting |
1). A stack overflow occurred in this case. I have fixed this by limiting |
| 147 |
the recursion depth to 10. |
the recursion depth to 10. |
| 148 |
|
|
| 149 |
26. Updated RunTest.bat in the distribution to the version supplied by Tom |
27. Updated RunTest.bat in the distribution to the version supplied by Tom |
| 150 |
Fortmann. This supports explicit test numbers on the command line, and has |
Fortmann. This supports explicit test numbers on the command line, and has |
| 151 |
argument validation and error reporting. |
argument validation and error reporting. |
| 152 |
|
|
| 153 |
27. An instance of \X with an unlimited repeat could fail if at any point the |
28. An instance of \X with an unlimited repeat could fail if at any point the |
| 154 |
first character it looked at was a mark character. |
first character it looked at was a mark character. |
| 155 |
|
|
| 156 |
28. Some minor code refactoring concerning Unicode properties and scripts |
29. Some minor code refactoring concerning Unicode properties and scripts |
| 157 |
should reduce the stack requirement of match() slightly. |
should reduce the stack requirement of match() slightly. |
| 158 |
|
|
| 159 |
29. Added the '=' option to pcretest to check the setting of unused capturing |
30. Added the '=' option to pcretest to check the setting of unused capturing |
| 160 |
slots at the end of the pattern, which are documented as being -1, but are |
slots at the end of the pattern, which are documented as being -1, but are |
| 161 |
not included in the return count. |
not included in the return count. |
| 162 |
|
|
| 163 |
30. If \k was not followed by a braced, angle-bracketed, or quoted name, PCRE |
31. If \k was not followed by a braced, angle-bracketed, or quoted name, PCRE |
| 164 |
compiled something random. Now it gives a compile-time error (as does |
compiled something random. Now it gives a compile-time error (as does |
| 165 |
Perl). |
Perl). |
| 166 |
|
|
| 167 |
31. A *MARK encountered during the processing of a positive assertion is now |
32. A *MARK encountered during the processing of a positive assertion is now |
| 168 |
recorded and passed back (compatible with Perl). |
recorded and passed back (compatible with Perl). |
| 169 |
|
|
| 170 |
32. If --only-matching or --colour was set on a pcregrep call whose pattern |
33. If --only-matching or --colour was set on a pcregrep call whose pattern |
| 171 |
had alternative anchored branches, the search for a second match in a line |
had alternative anchored branches, the search for a second match in a line |
| 172 |
was done as if at the line start. Thus, for example, /^01|^02/ incorrectly |
was done as if at the line start. Thus, for example, /^01|^02/ incorrectly |
| 173 |
matched the line "0102" twice. The same bug affected patterns that started |
matched the line "0102" twice. The same bug affected patterns that started |
| 174 |
with a backwards assertion. For example /\b01|\b02/ also matched "0102" |
with a backwards assertion. For example /\b01|\b02/ also matched "0102" |
| 175 |
twice. |
twice. |
| 176 |
|
|
| 177 |
33. Previously, PCRE did not allow quantification of assertions. However, Perl |
34. Previously, PCRE did not allow quantification of assertions. However, Perl |
| 178 |
does, and because of capturing effects, quantifying parenthesized |
does, and because of capturing effects, quantifying parenthesized |
| 179 |
assertions may at times be useful. Quantifiers are now allowed for |
assertions may at times be useful. Quantifiers are now allowed for |
| 180 |
parenthesized assertions. |
parenthesized assertions. |
| 181 |
|
|
| 182 |
34. A minor code tidy in pcre_compile() when checking options for \R usage. |
35. A minor code tidy in pcre_compile() when checking options for \R usage. |
| 183 |
|
|
| 184 |
35. \g was being checked for fancy things in a character class, when it should |
36. \g was being checked for fancy things in a character class, when it should |
| 185 |
just be a literal "g". |
just be a literal "g". |
| 186 |
|
|
| 187 |
36. PCRE was rejecting [:a[:digit:]] whereas Perl was not. It seems that the |
37. PCRE was rejecting [:a[:digit:]] whereas Perl was not. It seems that the |
| 188 |
appearance of a nested POSIX class supersedes an apparent external class. |
appearance of a nested POSIX class supersedes an apparent external class. |
| 189 |
For example, [:a[:digit:]b:] matches "a", "b", ":", or a digit. Also, |
For example, [:a[:digit:]b:] matches "a", "b", ":", or a digit. Also, |
| 190 |
unescaped square brackets may also appear as part of class names. For |
unescaped square brackets may also appear as part of class names. For |
| 191 |
example, [:a[:abc]b:] gives unknown class "[:abc]b:]". PCRE now behaves |
example, [:a[:abc]b:] gives unknown class "[:abc]b:]". PCRE now behaves |
| 192 |
more like Perl. |
more like Perl. |
| 193 |
|
|
| 194 |
37. PCRE was giving an error for \N with a braced quantifier such as {1,} (this |
38. PCRE was giving an error for \N with a braced quantifier such as {1,} (this |
| 195 |
was because it thought it was \N{name}, which is not supported). |
was because it thought it was \N{name}, which is not supported). |
| 196 |
|
|
| 197 |
38. Add minix to OS list not supporting the -S option in pcretest. |
39. Add minix to OS list not supporting the -S option in pcretest. |
| 198 |
|
|
| 199 |
39. PCRE tries to detect cases of infinite recursion at compile time, but it |
40. PCRE tries to detect cases of infinite recursion at compile time, but it |
| 200 |
cannot analyze patterns in sufficient detail to catch mutual recursions |
cannot analyze patterns in sufficient detail to catch mutual recursions |
| 201 |
such as ((?1))((?2)). There is now a runtime test that gives an error if a |
such as ((?1))((?2)). There is now a runtime test that gives an error if a |
| 202 |
subgroup is called recursively as a subpattern for a second time at the |
subgroup is called recursively as a subpattern for a second time at the |
| 203 |
same position in the subject string. In previous releases this might have |
same position in the subject string. In previous releases this might have |
| 204 |
been caught by the recursion limit, or it might have run out of stack. |
been caught by the recursion limit, or it might have run out of stack. |
| 205 |
|
|
| 206 |
40. A pattern such as /(?(R)a+|(?R)b)/ is quite safe, as the recursion can |
41. A pattern such as /(?(R)a+|(?R)b)/ is quite safe, as the recursion can |
| 207 |
happen only once. PCRE was, however incorrectly giving a compile time error |
happen only once. PCRE was, however incorrectly giving a compile time error |
| 208 |
"recursive call could loop indefinitely" because it cannot analyze the |
"recursive call could loop indefinitely" because it cannot analyze the |
| 209 |
pattern in sufficient detail. The compile time test no longer happens when |
pattern in sufficient detail. The compile time test no longer happens when |
| 210 |
PCRE is compiling a conditional subpattern, but actual runaway loops are |
PCRE is compiling a conditional subpattern, but actual runaway loops are |
| 211 |
now caught at runtime (see 39 above). |
now caught at runtime (see 40 above). |
| 212 |
|
|
| 213 |
41. It seems that Perl allows any characters other than a closing parenthesis |
42. It seems that Perl allows any characters other than a closing parenthesis |
| 214 |
to be part of the NAME in (*MARK:NAME) and other backtracking verbs. PCRE |
to be part of the NAME in (*MARK:NAME) and other backtracking verbs. PCRE |
| 215 |
has been changed to be the same. |
has been changed to be the same. |
| 216 |
|
|
| 217 |
42. Updated configure.ac to put in more quoting round AC_LANG_PROGRAM etc. so |
43. Updated configure.ac to put in more quoting round AC_LANG_PROGRAM etc. so |
| 218 |
as not to get warnings when autogen.sh is called. Also changed |
as not to get warnings when autogen.sh is called. Also changed |
| 219 |
AC_PROG_LIBTOOL (deprecated) to LT_INIT (the current macro). |
AC_PROG_LIBTOOL (deprecated) to LT_INIT (the current macro). |
| 220 |
|
|
| 221 |
43. To help people who use pcregrep to scan files containing exceedingly long |
44. To help people who use pcregrep to scan files containing exceedingly long |
| 222 |
lines, the following changes have been made: |
lines, the following changes have been made: |
| 223 |
|
|
| 224 |
(a) The default value of the buffer size parameter has been increased from |
(a) The default value of the buffer size parameter has been increased from |
| 225 |
8K to 20K. (A buffer three times this size is actually used.) |
8K to 20K. (The actual buffer used is three times this size.) |
| 226 |
|
|
| 227 |
(b) The default can be changed by ./configure --with-pcregrep-bufsiz when |
(b) The default can be changed by ./configure --with-pcregrep-bufsiz when |
| 228 |
PCRE is built. |
PCRE is built. |
| 236 |
(e) If a line being scanned overflows pcregrep's buffer, an error is now |
(e) If a line being scanned overflows pcregrep's buffer, an error is now |
| 237 |
given and the return code is set to 2. |
given and the return code is set to 2. |
| 238 |
|
|
| 239 |
44. Add a pointer to the latest mark to the callout data block. |
45. Add a pointer to the latest mark to the callout data block. |
| 240 |
|
|
| 241 |
45. The pattern /.(*F)/, when applied to "abc" with PCRE_PARTIAL_HARD, gave a |
46. The pattern /.(*F)/, when applied to "abc" with PCRE_PARTIAL_HARD, gave a |
| 242 |
partial match of an empty string instead of no match. This was specific to |
partial match of an empty string instead of no match. This was specific to |
| 243 |
the use of ".". |
the use of ".". |
| 244 |
|
|
| 245 |
46. The pattern /f.*/8s, when applied to "for" with PCRE_PARTIAL_HARD, gave a |
47. The pattern /f.*/8s, when applied to "for" with PCRE_PARTIAL_HARD, gave a |
| 246 |
complete match instead of a partial match. This bug was dependent on both |
complete match instead of a partial match. This bug was dependent on both |
| 247 |
the PCRE_UTF8 and PCRE_DOTALL options being set. |
the PCRE_UTF8 and PCRE_DOTALL options being set. |
| 248 |
|
|