I need to match a number that can be in the following format (and still be correct)
2.2
2.20
2.200
2.2000
2.20000
$bob = "2.201"; #this should test wrong
if ($bob =~ /2\.20.*/) {
print "right";
}
else {
print "wrong";
}
This returns right (because my code isn't correct) What is the syntax for "followed by 'none or more' Zero's" (being zero's only)?
I tried [0.*] but it still didn't work. I'm having a brain fart.
2.2
2.20
2.200
2.2000
2.20000
$bob = "2.201"; #this should test wrong
if ($bob =~ /2\.20.*/) {
print "right";
}
else {
print "wrong";
}
This returns right (because my code isn't correct) What is the syntax for "followed by 'none or more' Zero's" (being zero's only)?
I tried [0.*] but it still didn't work. I'm having a brain fart.