[Pcre-svn] [1382] code/trunk: Auto-possessify OP_CLASS and s…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1382] code/trunk: Auto-possessify OP_CLASS and some other bugfixes.
Revision: 1382
          http://vcs.pcre.org/viewvc?view=rev&revision=1382
Author:   zherczeg
Date:     2013-10-18 08:55:07 +0100 (Fri, 18 Oct 2013)


Log Message:
-----------
Auto-possessify OP_CLASS and some other bugfixes.

Modified Paths:
--------------
    code/trunk/pcre_compile.c
    code/trunk/testdata/testinput14
    code/trunk/testdata/testinput17
    code/trunk/testdata/testinput2
    code/trunk/testdata/testoutput10
    code/trunk/testdata/testoutput11-16
    code/trunk/testdata/testoutput11-32
    code/trunk/testdata/testoutput11-8
    code/trunk/testdata/testoutput14
    code/trunk/testdata/testoutput17
    code/trunk/testdata/testoutput2
    code/trunk/testdata/testoutput5
    code/trunk/testdata/testoutput7
    code/trunk/testdata/testoutput9


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/pcre_compile.c    2013-10-18 07:55:07 UTC (rev 1382)
@@ -2975,7 +2975,7 @@
   case OP_XCLASS:


   if (c == OP_XCLASS)
-    end = code + GET(code, 0);
+    end = code + GET(code, 0) - 1;
   else
 #endif
     end = code + 32 / sizeof(pcre_uchar);
@@ -3031,17 +3031,18 @@


static BOOL
compare_opcodes(const pcre_uchar *code, BOOL utf, const compile_data *cd,
- const pcre_uint32* base_list, const pcre_uchar *base_end)
+ const pcre_uint32 *base_list, const pcre_uchar *base_end)
{
pcre_uchar c;
pcre_uint32 list[8];
-const pcre_uint32* chr_ptr;
-const pcre_uint32* ochr_ptr;
-const pcre_uint32* list_ptr;
+const pcre_uint32 *chr_ptr;
+const pcre_uint32 *ochr_ptr;
+const pcre_uint32 *list_ptr;
const pcre_uchar *next_code;
-const pcre_uint8 *class_bits;
+const pcre_uint8 *class_bitset;
+const pcre_uint32 *set1, *set2, *set_end;
pcre_uint32 chr;
-BOOL accepted;
+BOOL accepted, invert_bits;

 /* Note: the base_list[1] contains whether the current opcode has greedy
 (represented by a non-zero value) quantifier. This is a different from
@@ -3163,6 +3164,92 @@
     list_ptr = base_list;
     }


+  /* Character bitsets can also be compared to certain opcodes. */
+
+  else if (base_list[0] == OP_CLASS || list[0] == OP_CLASS
+#ifdef COMPILE_PCRE8
+      /* In 8 bit, non-UTF mode, OP_CLASS and OP_NCLASS are the same. */
+      || (!utf && (base_list[0] == OP_NCLASS || list[0] == OP_NCLASS))
+#endif
+      )
+    {
+#ifdef COMPILE_PCRE8
+    if (base_list[0] == OP_CLASS || (!utf && base_list[0] == OP_NCLASS))
+#else
+    if (base_list[0] == OP_CLASS)
+#endif
+      {
+      set1 = (pcre_uint32 *)(base_end - base_list[2]);
+      list_ptr = list;
+      }
+    else
+      {
+      set1 = (pcre_uint32 *)(code - list[2]);
+      list_ptr = base_list;
+      }
+
+    invert_bits = FALSE;
+    switch(list_ptr[0])
+      {
+      case OP_CLASS:
+      case OP_NCLASS:
+      set2 = (pcre_uint32 *)
+        ((list_ptr == list ? code : base_end) - list_ptr[2]);
+      break;
+
+      /* OP_XCLASS cannot be supported here, because its bitset
+      is not necessarily complete. E.g: [a-\0x{200}] is stored
+      as a character range, and the appropriate bits are not set. */
+
+      case OP_NOT_DIGIT:
+        invert_bits = TRUE;
+        /* Fall through */
+      case OP_DIGIT:
+        set2 = (pcre_uint32 *)(cd->cbits + cbit_digit);
+        break;
+
+      case OP_NOT_WHITESPACE:
+        invert_bits = TRUE;
+        /* Fall through */
+      case OP_WHITESPACE:
+        set2 = (pcre_uint32 *)(cd->cbits + cbit_space);
+        break;
+
+      case OP_NOT_WORDCHAR:
+        invert_bits = TRUE;
+        /* Fall through */
+      case OP_WORDCHAR:
+        set2 = (pcre_uint32 *)(cd->cbits + cbit_word);
+        break;
+
+      default:
+      return FALSE;
+      }
+
+    /* Compare 4 bytes to improve speed. */
+    set_end = set1 + (32 / 4);
+    if (invert_bits)
+      {
+      do
+        {
+        if ((*set1++ & ~(*set2++)) != 0) return FALSE;
+        }
+      while (set1 < set_end);
+      }
+    else
+      {
+      do
+        {
+        if ((*set1++ & *set2++) != 0) return FALSE;
+        }
+      while (set1 < set_end);
+      }
+
+    if (list[1] == 0) return TRUE;
+    /* Might be an empty repeat. */
+    continue;
+    }
+
   /* Some property combinations also acceptable. Unicode property opcodes are
   processed specially; the rest can be handled with a lookup table. */


@@ -3414,16 +3501,15 @@

       case OP_CLASS:
       if (chr > 255) break;
-      class_bits = (pcre_uint8 *)((list_ptr == list ? code : base_end) - list_ptr[2]);
-      if ((class_bits[chr >> 3] & (1 << (chr & 7))) != 0)
-        return FALSE;
+      class_bitset = (pcre_uint8 *)
+        ((list_ptr == list ? code : base_end) - list_ptr[2]);
+      if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE;
       break;


 #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
       case OP_XCLASS:
-      if (list_ptr != list) return FALSE;   /* Class is first opcode */
-      if (PRIV(xclass)(chr, code - list_ptr[2] + LINK_SIZE, utf))
-        return FALSE;
+      if (PRIV(xclass)(chr, (list_ptr == list ? code : base_end) -
+          list_ptr[2] + LINK_SIZE, utf)) return FALSE;
       break;
 #endif


@@ -3465,7 +3551,7 @@
{
register pcre_uchar c;
const pcre_uchar *end;
-pcre_uchar *repeat_code;
+pcre_uchar *repeat_opcode;
pcre_uint32 list[8];

 for (;;)
@@ -3522,12 +3608,12 @@
     {
 #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
     if (c == OP_XCLASS)
-      repeat_code = code + 1 + GET(code, 1);
+      repeat_opcode = code + GET(code, 1);
     else
 #endif
-      repeat_code = code + 1 + (32 / sizeof(pcre_uchar));
+      repeat_opcode = code + 1 + (32 / sizeof(pcre_uchar));


-    c = *repeat_code;
+    c = *repeat_opcode;
     if (c >= OP_CRSTAR && c <= OP_CRMINRANGE)
       {
       /* end must not be NULL. */
@@ -3540,19 +3626,23 @@
         switch (c)
           {
           case OP_CRSTAR:
-          *repeat_code = OP_CRPOSSTAR;
+          case OP_CRMINSTAR:
+          *repeat_opcode = OP_CRPOSSTAR;
           break;


           case OP_CRPLUS:
-          *repeat_code = OP_CRPOSPLUS;
+          case OP_CRMINPLUS:
+          *repeat_opcode = OP_CRPOSPLUS;
           break;


           case OP_CRQUERY:
-          *repeat_code = OP_CRPOSQUERY;
+          case OP_CRMINQUERY:
+          *repeat_opcode = OP_CRPOSQUERY;
           break;


           case OP_CRRANGE:
-          *repeat_code = OP_CRPOSRANGE;
+          case OP_CRMINRANGE:
+          *repeat_opcode = OP_CRPOSRANGE;
           break;
           }
         }


Modified: code/trunk/testdata/testinput14
===================================================================
--- code/trunk/testdata/testinput14    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testinput14    2013-10-18 07:55:07 UTC (rev 1382)
@@ -333,4 +333,8 @@


/[\u0100-\u0200]/<JS>

+/[^\x00-a]{12,}[^b-\xff]*/BZ
+
+/[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/BZ
+
/-- End of testinput14 --/

Modified: code/trunk/testdata/testinput17
===================================================================
--- code/trunk/testdata/testinput17    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testinput17    2013-10-18 07:55:07 UTC (rev 1382)
@@ -293,4 +293,10 @@
 /^\x{ffff}{0,3}/i
     \x{ffff}


+/[^\x00-a]{12,}[^b-\xff]*/BZ
+
+/[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/BZ
+
+/a*[b-\x{200}]?a#a*[b-\x{200}]?b#[a-f]*[g-\x{200}]*#[g-\x{200}]*[a-c]*#[g-\x{200}]*[a-h]*/BZ
+
/-- End of testinput17 --/

Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testinput2    2013-10-18 07:55:07 UTC (rev 1382)
@@ -3936,6 +3936,10 @@


/\d+\s{0,5}=\s*\S?=\w{0,4}\W*/BZ

+/[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ
+
+/[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/BZ
+
/-- End of special auto-possessive tests --/

/^A\o{1239}B/

Modified: code/trunk/testdata/testoutput10
===================================================================
--- code/trunk/testdata/testoutput10    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput10    2013-10-18 07:55:07 UTC (rev 1382)
@@ -754,23 +754,10 @@
 /[\p{Nd}+-]+/8
     1234
  0: 1234
- 1: 123
- 2: 12
- 3: 1
     12-34
  0: 12-34
- 1: 12-3
- 2: 12-
- 3: 12
- 4: 1
     12+\x{661}-34  
  0: 12+\x{661}-34
- 1: 12+\x{661}-3
- 2: 12+\x{661}-
- 3: 12+\x{661}
- 4: 12+
- 5: 12
- 6: 1
     ** Failers
 No match
     abcd  
@@ -779,20 +766,8 @@
 /[\P{Nd}]+/8
     abcd
  0: abcd
- 1: abc
- 2: ab
- 3: a
     ** Failers
  0: ** Failers
- 1: ** Failer
- 2: ** Faile
- 3: ** Fail
- 4: ** Fai
- 5: ** Fa
- 6: ** F
- 7: ** 
- 8: **
- 9: *
     1234
 No match


@@ -1611,9 +1586,6 @@
 /[\x{c0}\x{116}]+/8i
     \x{c0}\x{e0}\x{116}\x{117}
  0: \x{c0}\x{e0}\x{116}\x{117}
- 1: \x{c0}\x{e0}\x{116}
- 2: \x{c0}\x{e0}
- 3: \x{c0}


/Check property support in non-UTF-8 mode/

@@ -1692,16 +1664,6 @@
 /^[\p{Xan}]+/8
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  0: ABCD1234\x{6ca}\x{a6c}\x{10a7}
- 1: ABCD1234\x{6ca}\x{a6c}
- 2: ABCD1234\x{6ca}
- 3: ABCD1234
- 4: ABCD123
- 5: ABCD12
- 6: ABCD1
- 7: ABCD
- 8: ABC
- 9: AB
-10: A
     ** Failers
 No match
     _ABC   
@@ -1813,14 +1775,6 @@
 /^>[\p{Xps}]+/8
     > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
- 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}
- 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}
- 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}
- 4: > \x{09}\x{0a}\x{0c}\x{0d}
- 5: > \x{09}\x{0a}\x{0c}
- 6: > \x{09}\x{0a}
- 7: > \x{09}
- 8: > 


 /^\p{Xwd}/8
     ABCD
@@ -1873,17 +1827,6 @@
 /^[\p{Xwd}]+/8
     ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_
- 1: ABCD1234\x{6ca}\x{a6c}\x{10a7}
- 2: ABCD1234\x{6ca}\x{a6c}
- 3: ABCD1234\x{6ca}
- 4: ABCD1234
- 5: ABCD123
- 6: ABCD12
- 7: ABCD1
- 8: ABCD
- 9: ABC
-10: AB
-11: A


/-- Unicode properties for \b abd \B --/

@@ -2164,7 +2107,6 @@
 /[z\x{1e9e}]+/8i
     \x{1e9e}\x{00df}
  0: \x{1e9e}\x{df}
- 1: \x{1e9e}


 /\x{00df}+/8i
     \x{1e9e}\x{00df}
@@ -2173,7 +2115,6 @@
 /[z\x{00df}]+/8i
     \x{1e9e}\x{00df}
  0: \x{1e9e}\x{df}
- 1: \x{1e9e}


 /\x{1f88}+/8i
     \x{1f88}\x{1f80} 
@@ -2182,7 +2123,6 @@
 /[z\x{1f88}]+/8i
     \x{1f88}\x{1f80} 
  0: \x{1f88}\x{1f80}
- 1: \x{1f88}


/-- Perl matches these --/

@@ -2559,11 +2499,6 @@
 /^[\p{Xuc}]+/8
     $@`\x{a0}\x{1234}\x{e000}**
  0: $@`\x{a0}\x{1234}\x{e000}
- 1: $@`\x{a0}\x{1234}
- 2: $@`\x{a0}
- 3: $@`
- 4: $@
- 5: $
     ** Failers
 No match
     \x{9f}


Modified: code/trunk/testdata/testoutput11-16
===================================================================
--- code/trunk/testdata/testoutput11-16    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput11-16    2013-10-18 07:55:07 UTC (rev 1382)
@@ -502,7 +502,7 @@
 Memory allocation (code space): 58
 ------------------------------------------------------------------
   0  26 Bra
-  2     [+\-\p{Nd}]+
+  2     [+\-\p{Nd}]++
  26  26 Ket
  28     End
 ------------------------------------------------------------------
@@ -651,7 +651,7 @@
 /[[:^alpha:][:^cntrl:]]+/8WB
 ------------------------------------------------------------------
   0  26 Bra
-  2     [ -~\x80-\xff\P{L}]+
+  2     [ -~\x80-\xff\P{L}]++
  26  26 Ket
  28     End
 ------------------------------------------------------------------
@@ -659,7 +659,7 @@
 /[[:^cntrl:][:^alpha:]]+/8WB
 ------------------------------------------------------------------
   0  26 Bra
-  2     [ -~\x80-\xff\P{L}]+
+  2     [ -~\x80-\xff\P{L}]++
  26  26 Ket
  28     End
 ------------------------------------------------------------------
@@ -667,7 +667,7 @@
 /[[:alpha:]]+/8WB
 ------------------------------------------------------------------
   0  10 Bra
-  2     [\p{L}]+
+  2     [\p{L}]++
  10  10 Ket
  12     End
 ------------------------------------------------------------------
@@ -675,7 +675,7 @@
 /[[:^alpha:]\S]+/8WB
 ------------------------------------------------------------------
   0  13 Bra
-  2     [\P{L}\P{Xsp}]+
+  2     [\P{L}\P{Xsp}]++
  13  13 Ket
  15     End
 ------------------------------------------------------------------


Modified: code/trunk/testdata/testoutput11-32
===================================================================
--- code/trunk/testdata/testoutput11-32    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput11-32    2013-10-18 07:55:07 UTC (rev 1382)
@@ -502,7 +502,7 @@
 Memory allocation (code space): 84
 ------------------------------------------------------------------
   0  18 Bra
-  2     [+\-\p{Nd}]+
+  2     [+\-\p{Nd}]++
  18  18 Ket
  20     End
 ------------------------------------------------------------------
@@ -651,7 +651,7 @@
 /[[:^alpha:][:^cntrl:]]+/8WB
 ------------------------------------------------------------------
   0  18 Bra
-  2     [ -~\x80-\xff\P{L}]+
+  2     [ -~\x80-\xff\P{L}]++
  18  18 Ket
  20     End
 ------------------------------------------------------------------
@@ -659,7 +659,7 @@
 /[[:^cntrl:][:^alpha:]]+/8WB
 ------------------------------------------------------------------
   0  18 Bra
-  2     [ -~\x80-\xff\P{L}]+
+  2     [ -~\x80-\xff\P{L}]++
  18  18 Ket
  20     End
 ------------------------------------------------------------------
@@ -667,7 +667,7 @@
 /[[:alpha:]]+/8WB
 ------------------------------------------------------------------
   0  10 Bra
-  2     [\p{L}]+
+  2     [\p{L}]++
  10  10 Ket
  12     End
 ------------------------------------------------------------------
@@ -675,7 +675,7 @@
 /[[:^alpha:]\S]+/8WB
 ------------------------------------------------------------------
   0  13 Bra
-  2     [\P{L}\P{Xsp}]+
+  2     [\P{L}\P{Xsp}]++
  13  13 Ket
  15     End
 ------------------------------------------------------------------


Modified: code/trunk/testdata/testoutput11-8
===================================================================
--- code/trunk/testdata/testoutput11-8    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput11-8    2013-10-18 07:55:07 UTC (rev 1382)
@@ -502,7 +502,7 @@
 Memory allocation (code space): 48
 ------------------------------------------------------------------
   0  44 Bra
-  3     [+\-\p{Nd}]+
+  3     [+\-\p{Nd}]++
  44  44 Ket
  47     End
 ------------------------------------------------------------------
@@ -651,7 +651,7 @@
 /[[:^alpha:][:^cntrl:]]+/8WB
 ------------------------------------------------------------------
   0  44 Bra
-  3     [ -~\x80-\xff\P{L}]+
+  3     [ -~\x80-\xff\P{L}]++
  44  44 Ket
  47     End
 ------------------------------------------------------------------
@@ -659,7 +659,7 @@
 /[[:^cntrl:][:^alpha:]]+/8WB
 ------------------------------------------------------------------
   0  44 Bra
-  3     [ -~\x80-\xff\P{L}]+
+  3     [ -~\x80-\xff\P{L}]++
  44  44 Ket
  47     End
 ------------------------------------------------------------------
@@ -667,7 +667,7 @@
 /[[:alpha:]]+/8WB
 ------------------------------------------------------------------
   0  12 Bra
-  3     [\p{L}]+
+  3     [\p{L}]++
  12  12 Ket
  15     End
 ------------------------------------------------------------------
@@ -675,7 +675,7 @@
 /[[:^alpha:]\S]+/8WB
 ------------------------------------------------------------------
   0  15 Bra
-  3     [\P{L}\P{Xsp}]+
+  3     [\P{L}\P{Xsp}]++
  15  15 Ket
  18     End
 ------------------------------------------------------------------


Modified: code/trunk/testdata/testoutput14
===================================================================
--- code/trunk/testdata/testoutput14    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput14    2013-10-18 07:55:07 UTC (rev 1382)
@@ -496,4 +496,32 @@
 /[\u0100-\u0200]/<JS>
 Failed: character value in \u.... sequence is too large at offset 6


+/[^\x00-a]{12,}[^b-\xff]*/BZ
+------------------------------------------------------------------
+        Bra
+        [b-\xff] (neg){12,}+
+        [\x00-a] (neg)*+
+        Ket
+        End
+------------------------------------------------------------------
+
+/[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/BZ
+------------------------------------------------------------------
+        Bra
+        [\x00-\x08\x0e-\x1f!-\xff] (neg)*+
+        \s*
+         
+        [0-9A-Z_a-z]++
+        \W+
+         
+        [\x00-/:-\xff] (neg)*+
+        \d
+        0 
+        [\x00-/:-@[-^`{-\xff] (neg){4,6}+
+        \w*
+        A
+        Ket
+        End
+------------------------------------------------------------------
+
 /-- End of testinput14 --/


Modified: code/trunk/testdata/testoutput17
===================================================================
--- code/trunk/testdata/testoutput17    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput17    2013-10-18 07:55:07 UTC (rev 1382)
@@ -243,7 +243,7 @@
 /[\h]+/BZ
 ------------------------------------------------------------------
         Bra
-        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}]+
+        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -281,7 +281,7 @@
 /[\h\x{dc00}]+/BZSI
 ------------------------------------------------------------------
         Bra
-        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{dc00}]+
+        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{dc00}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -337,7 +337,7 @@
 /[\v\x{dc00}]+/BZSI
 ------------------------------------------------------------------
         Bra
-        [\x0a-\x0d\x85\x{2028}-\x{2029}\x{dc00}]+
+        [\x0a-\x0d\x85\x{2028}-\x{2029}\x{dc00}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -500,4 +500,53 @@
     \x{ffff}
  0: \x{ffff}


+/[^\x00-a]{12,}[^b-\xff]*/BZ
+------------------------------------------------------------------
+        Bra
+        [b-\xff] (neg){12,}
+        [\x00-a] (neg)*+
+        Ket
+        End
+------------------------------------------------------------------
+
+/[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/BZ
+------------------------------------------------------------------
+        Bra
+        [\x00-\x08\x0e-\x1f!-\xff] (neg)*
+        \s*
+         
+        [0-9A-Z_a-z]++
+        \W+
+         
+        [\x00-/:-\xff] (neg)*?
+        \d
+        0 
+        [\x00-/:-@[-^`{-\xff] (neg){4,6}?
+        \w*
+        A
+        Ket
+        End
+------------------------------------------------------------------
+
+/a*[b-\x{200}]?a#a*[b-\x{200}]?b#[a-f]*[g-\x{200}]*#[g-\x{200}]*[a-c]*#[g-\x{200}]*[a-h]*/BZ
+------------------------------------------------------------------
+        Bra
+        a*
+        [b-\x{200}]?+
+        a#
+        a*+
+        [b-\x{200}]?
+        b#
+        [a-f]*
+        [g-\x{200}]*+
+        #
+        [g-\x{200}]*
+        [a-c]*+
+        #
+        [g-\x{200}]*
+        [a-h]*+
+        Ket
+        End
+------------------------------------------------------------------
+
 /-- End of testinput17 --/


Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput2    2013-10-18 07:55:07 UTC (rev 1382)
@@ -13781,6 +13781,54 @@
         End
 ------------------------------------------------------------------


+/[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ
+------------------------------------------------------------------
+        Bra
+        [a-d]{5,12}+
+        [0-9e-z]*+
+        #
+        [\x00-`{-\xff] (neg)++
+        [b-y]*+
+        a
+        [2-7]?+
+        [\x00-/:-`{-\xff] (neg)++
+        Ket
+        End
+------------------------------------------------------------------
+
+/[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/BZ
+------------------------------------------------------------------
+        Bra
+        [a-z]*+
+        \s
+        #
+        [\x09 ]?+
+        \S
+        #
+        [a-c]*
+        \S
+        #
+        [C-G]++
+        \d
+        #
+        [4-8]*+
+        \D
+        #
+        [,4-9]*
+        \D
+        #
+        [!$]{0,5}+
+        \w
+        #
+        [M-Xf-l]++
+        \W
+        #
+        [,a-c]?
+        \W
+        Ket
+        End
+------------------------------------------------------------------
+
 /-- End of special auto-possessive tests --/


/^A\o{1239}B/

Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput5    2013-10-18 07:55:07 UTC (rev 1382)
@@ -792,7 +792,7 @@
 /[\h]{3,}/8BZ
 ------------------------------------------------------------------
         Bra
-        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}]{3,}
+        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}]{3,}+
         Ket
         End
 ------------------------------------------------------------------
@@ -1598,7 +1598,7 @@
 /[\h\x{e000}]+/8BZ
 ------------------------------------------------------------------
         Bra
-        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{e000}]+
+        [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{e000}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -1620,7 +1620,7 @@
 /[\H\x{d7ff}]+/8BZ
 ------------------------------------------------------------------
         Bra
-        [\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]+
+        [\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -1642,7 +1642,7 @@
 /[\v\x{e000}]+/8BZ
 ------------------------------------------------------------------
         Bra
-        [\x0a-\x0d\x85\x{2028}-\x{2029}\x{e000}]+
+        [\x0a-\x0d\x85\x{2028}-\x{2029}\x{e000}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -1660,7 +1660,7 @@
 /[\V\x{d7ff}]+/8BZ
 ------------------------------------------------------------------
         Bra
-        [\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]+
+        [\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]++
         Ket
         End
 ------------------------------------------------------------------


Modified: code/trunk/testdata/testoutput7
===================================================================
--- code/trunk/testdata/testoutput7    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput7    2013-10-18 07:55:07 UTC (rev 1382)
@@ -78,7 +78,7 @@
 /[\p{Nd}+-]+/8DZ
 ------------------------------------------------------------------
         Bra
-        [+\-\p{Nd}]+
+        [+\-\p{Nd}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -949,7 +949,7 @@
 /[[:^alpha:][:^cntrl:]]+/8WBZ
 ------------------------------------------------------------------
         Bra
-        [ -~\x80-\xff\P{L}]+
+        [ -~\x80-\xff\P{L}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -961,7 +961,7 @@
 /[[:^cntrl:][:^alpha:]]+/8WBZ
 ------------------------------------------------------------------
         Bra
-        [ -~\x80-\xff\P{L}]+
+        [ -~\x80-\xff\P{L}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -973,7 +973,7 @@
 /[[:alpha:]]+/8WBZ
 ------------------------------------------------------------------
         Bra
-        [\p{L}]+
+        [\p{L}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -983,7 +983,7 @@
 /[[:^alpha:]\S]+/8WBZ
 ------------------------------------------------------------------
         Bra
-        [\P{L}\P{Xsp}]+
+        [\P{L}\P{Xsp}]++
         Ket
         End
 ------------------------------------------------------------------
@@ -995,7 +995,7 @@
 /[^\d]+/8WBZ
 ------------------------------------------------------------------
         Bra
-        [^\p{Nd}]+
+        [^\p{Nd}]++
         Ket
         End
 ------------------------------------------------------------------


Modified: code/trunk/testdata/testoutput9
===================================================================
--- code/trunk/testdata/testoutput9    2013-10-16 06:23:00 UTC (rev 1381)
+++ code/trunk/testdata/testoutput9    2013-10-18 07:55:07 UTC (rev 1382)
@@ -751,8 +751,6 @@
  0: \x{200}
    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}\x{100}\x{200}
- 1: \x{200}\x{100}
- 2: \x{200}
    *** Failers  
 No match


@@ -775,8 +773,6 @@
  0: \x{200}
    ab\x{200}\x{100}\x{200}\x{100}cd
  0: \x{200}\x{100}\x{200}
- 1: \x{200}\x{100}
- 2: \x{200}
    *** Failers  
 No match