From: Vincent Pit Date: Sat, 11 Sep 2010 13:21:14 +0000 (+0200) Subject: Regexp overhaul in CPANPLUS::Dist::Gentoo::Version X-Git-Tag: v0.11~21 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5d1a0ae140fffe0e908f786d8ecd32f07a129e13;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Regexp overhaul in CPANPLUS::Dist::Gentoo::Version --- diff --git a/lib/CPANPLUS/Dist/Gentoo/Version.pm b/lib/CPANPLUS/Dist/Gentoo/Version.pm index b8e92c5..47cec96 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Version.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Version.pm @@ -28,10 +28,10 @@ use overload ( '""' => \&_stringify, ); -my $int_rx = qr/\d+/; -my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/; +my $int_rx = qr/[0-9]+/; +my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/o; -our $version_rx = qr/$dotted_num_rx(?:_p$dotted_num_rx)?(?:-r$int_rx)?/; +our $version_rx = qr/$dotted_num_rx(?:_p$dotted_num_rx)?(?:-r$int_rx)?/o; =head1 METHODS @@ -49,7 +49,7 @@ sub new { if (defined $vstring) { $vstring =~ s/^[._]+//g; $vstring =~ s/[._]+$//g; - if ($vstring =~ /^($dotted_num_rx)(?:_p($dotted_num_rx))?(?:-r($int_rx))?$/) { + if ($vstring =~ /^($dotted_num_rx)(?:_p($dotted_num_rx))?(?:-r($int_rx))?$/o){ return bless { string => $vstring, version => [ split /\.+/, $1 ],