Skip Menu |

This queue is for tickets about the Regexp-Compare CPAN distribution.

Report information
The Basics
Id: 19864
Status: resolved
Priority: 0/
Queue: Regexp-Compare

People
Owner: Nobody in particular
Requestors: agentzh [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



Subject: Bugs for regexes with {n} quantifiers
According to perlre, regex a{n} means exactly n times of a, so regex "a{2}" should be equivalent to regex "aa". Unfortunately the corresponding test fails on Regexp::Compare: # bug.t use Test::More tests => 2; use Regexp::Compare qw(is_less_or_equal); my ($a, $b) = ('aa', 'a{2}'); ok is_less_or_equal($a, $b), "$a <= $b"; ok is_less_or_equal($b, $a), "$b <= $a"; The result of "nmake test" is as follows: Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/bug.t 1 256 2 1 50.00% 2
Subject: bug.t
use Test::More tests => 2; use Regexp::Compare qw(is_less_or_equal); my ($a, $b) = ('aa', 'a{2}'); ok is_less_or_equal($a, $b), "$a <= $b"; ok is_less_or_equal($b, $a), "$b <= $a";
On Tue Jun 13 05:52:11 2006, guest wrote: Show quoted text
> According to perlre, regex a{n} means exactly n times of a, so regex > "a{2}" should be equivalent to regex "aa". Unfortunately the > corresponding test fails on Regexp::Compare:
Yes, that's worth fixing (in version 0.04, now going into CPAN), but I'd like to stress there's probably a lot of equivalent regexps which don't compare - the module really doesn't handle _all_ possibilities... Nonetheless, if you find the next simplest such pair, do let me know. :-)