[Pcre-svn] [746] code/trunk: Caseless matching of backrefere…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [746] code/trunk: Caseless matching of backreferences with fixed length repetitions was broken .
Revision: 746
          http://vcs.pcre.org/viewvc?view=rev&revision=746
Author:   ph10
Date:     2011-11-15 15:07:02 +0000 (Tue, 15 Nov 2011)


Log Message:
-----------
Caseless matching of backreferences with fixed length repetitions was broken.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_compile.c
    code/trunk/testdata/testinput1
    code/trunk/testdata/testoutput1


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2011-11-14 11:41:03 UTC (rev 745)
+++ code/trunk/ChangeLog    2011-11-15 15:07:02 UTC (rev 746)
@@ -20,7 +20,11 @@
 5.  Supporting of \x, \U and \u in JavaScript compatibility mode based on the
     ECMA-262 standard.


+6.  Lookbehinds such as (?<=a{2}b) that contained a fixed repetition were
+    erroneously being rejected as "not fixed length" if PCRE_CASELESS was set.
+    This bug was probably introduced by change 9 of 8.13. 


+
Version 8.20 21-Oct-2011
------------------------


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2011-11-14 11:41:03 UTC (rev 745)
+++ code/trunk/pcre_compile.c    2011-11-15 15:07:02 UTC (rev 746)
@@ -1646,6 +1646,7 @@
     need to skip over a multibyte character in UTF8 mode.  */


     case OP_EXACT:
+    case OP_EXACTI: 
     branchlength += GET2(cc,1);
     cc += 4;
 #ifdef SUPPORT_UTF8


Modified: code/trunk/testdata/testinput1
===================================================================
--- code/trunk/testdata/testinput1    2011-11-14 11:41:03 UTC (rev 745)
+++ code/trunk/testdata/testinput1    2011-11-15 15:07:02 UTC (rev 746)
@@ -4251,4 +4251,14 @@
 /[:a]xxx[b:]/
      :xxx:


+/(?<=a{2})b/i
+    xaabc
+    ** Failers
+    xabc  
+
+/(?<!a{2})b/i
+    xabc
+    ** Failers
+    xaabc  
+
 /-- End of testinput1 --/


Modified: code/trunk/testdata/testoutput1
===================================================================
--- code/trunk/testdata/testoutput1    2011-11-14 11:41:03 UTC (rev 745)
+++ code/trunk/testdata/testoutput1    2011-11-15 15:07:02 UTC (rev 746)
@@ -6952,4 +6952,20 @@
      :xxx:
  0: :xxx:


+/(?<=a{2})b/i
+    xaabc
+ 0: b
+    ** Failers
+No match
+    xabc  
+No match
+
+/(?<!a{2})b/i
+    xabc
+ 0: b
+    ** Failers
+No match
+    xaabc  
+No match
+
 /-- End of testinput1 --/