[ID 20000803.001] further regexp counting problems
authorHugo van der Sanden <hv@crypt.org>
Thu, 3 Aug 2000 18:25:30 +0000 (19:25 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 3 Aug 2000 23:40:37 +0000 (23:40 +0000)
Message-Id: <200008031725.SAA10580@crypt.compulink.co.uk>

p4raw-id: //depot/perl@6508

regcomp.c
t/op/re_tests

index a15eb23..f092e7e 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -904,6 +904,8 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da
                        } else {
                            /* start offset must point into the last copy */
                            data->last_start_min += minnext * (mincount - 1);
+                           data->last_start_max += is_inf ? 0 : (maxcount - 1)
+                               * (minnext + data->pos_delta);
                        }
                    }
                    /* It is counted once already... */
index 8df1fc9..3848325 100644 (file)
@@ -756,6 +756,18 @@ tt+$       xxxtt   y       -       -
 ^(.,){2}c      a,b,c   y       $1      b,
 ^(?:[^,]*,){2}c        a,b,c   y       -       -
 ^([^,]*,){2}c  a,b,c   y       $1      b,
+^([^,]*,){3}d  aaa,b,c,d       y       $1      c,
+^([^,]*,){3,}d aaa,b,c,d       y       $1      c,
+^([^,]*,){0,3}d        aaa,b,c,d       y       $1      c,
+^([^,]{1,3},){3}d      aaa,b,c,d       y       $1      c,
+^([^,]{1,3},){3,}d     aaa,b,c,d       y       $1      c,
+^([^,]{1,3},){0,3}d    aaa,b,c,d       y       $1      c,
+^([^,]{1,},){3}d       aaa,b,c,d       y       $1      c,
+^([^,]{1,},){3,}d      aaa,b,c,d       y       $1      c,
+^([^,]{1,},){0,3}d     aaa,b,c,d       y       $1      c,
+^([^,]{0,3},){3}d      aaa,b,c,d       y       $1      c,
+^([^,]{0,3},){3,}d     aaa,b,c,d       y       $1      c,
+^([^,]{0,3},){0,3}d    aaa,b,c,d       y       $1      c,
 (?i)           y       -       -
 '(?!\A)x'm     a\nxb\n y       -       -
 ^(a(b)?)+$     aba     y       -$1-$2- -a--