in reply to Comparing revision numbers

You could cheat and normalize and then convert the revision on the left side into all potentially matching revisions and then check whether the right side is one of those:

#!perl -w use strict; my $left = '2.10'; my $right = '02.10'; sub normalize { # just strip leading zeroes my ($ver) = @_; $ver =~ s/^0+//; $ver }; sub candidates { my ($ver) = @_; my @res = normalize $ver; (my $minor_wild = $ver) =~ s/\.\d+/*/; push @res, $minor_wild; push @res, '*' unless $ver eq '*'; @res }; for my $right (qw(2.0 2.1 2.10 02.10 2.*)) { print join("\t", $left, $right, (grep { $right eq $_ } candidates( +$left)) ? 'equal' : 'inequal'), "\n"; };