From: Hugo van der Sanden Date: Thu, 3 Aug 2000 18:25:30 +0000 (+0100) Subject: [ID 20000803.001] further regexp counting problems X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4b2cff9afa2c02937e1460d801fda356385d3841;p=p5sagit%2Fp5-mst-13.2.git [ID 20000803.001] further regexp counting problems Message-Id: <200008031725.SAA10580@crypt.compulink.co.uk> p4raw-id: //depot/perl@6508 --- diff --git a/regcomp.c b/regcomp.c index a15eb23..f092e7e 100644 --- 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... */ diff --git a/t/op/re_tests b/t/op/re_tests index 8df1fc9..3848325 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -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--