Subject: | optimized regexp problem |
Hi,
I'm using Regexp-Optimizer 0.15 with perl 5.8.7 under FreeBSD 6.0-RELEASE.
I didn't dig much into the code to find what's the actual problem,
however it's seems easy to reproduce:
case 1, $o->optimize(qr/(?:1|2|3|4|5|6|7|8|9|10|11)/) returns
'(?-xism:(?:1[01]?|[23456789]))', which is correct, it matches any of
the digit.
case 2, $o->optimize(qr/(?:1|2|3|4|5|6|7|8|9|10)/); returns
'(?-xism:(?:1(?:)?|[23456789]))', which is not valid, it won't match 10,
the regexp should be '(?-xism:(?:1(?:0)?|[23456789]))'
Again, i didn't really look at the code, but i could only reproduce the
bug when the last token of the alternation end with '0'.
Vincent