diff options
author | Gurusamy Sarathy <gsar@engin.umich.edu> | 1996-12-20 21:59:22 -0500 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1996-12-23 12:58:58 +1200 |
commit | 579cf2c30d1c2eed351c0a6945d08a57bdcd1f6b (patch) | |
tree | c4e4dd7a5803a0e0b5f4b9d664f36c6b9372f945 /regexec.c | |
parent | b2b8e269a606666f8c956ef04b81b71188e99229 (diff) | |
download | perl-579cf2c30d1c2eed351c0a6945d08a57bdcd1f6b.tar.gz |
patch for regex bug: (x|x){n}
On Mon, 16 Dec 1996 18:04:08 EST, I wrote:
>
>7. Symmetry confounds quantified regex alternation
>
>A well-researched bug report sent in by Charles Bailey:
>
> Message-Id: <01IA10O8ZIB600219C@hmivax.humgen.upenn.edu>,
> Subject: Regex bug: (x|x){n}
>
>Pity I didn't have time to take a closer look at that one.
Here's a patch for the problem reported in the reference above.
Simpler test cases:
% perl -we '$_ = "atatttta"; print "|$1|$2|\n" if /((t|t){3})/;'
says "|t||" instead of instead of "|ttt|t|"; and
% perl -we '$_ = "atatttta"; print "|$1|$2|\n" if /((t|t){3,})/;'
says "|t||" instead of instead of "|tttt|t|"; and
p5p-msgid: <199612210259.VAA10170@aatma.engin.umich.edu>
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -891,7 +891,7 @@ char *prog; /* If degenerate scan matches "", assume scan done. */ - if (locinput == cc->lastloc) { + if (locinput == cc->lastloc && n >= cc->min) { regcc = cc->oldcc; ln = regcc->cur; if (regmatch(cc->next)) |