Hi....have a very simple reg exp, but I cant get it to work as I want.
Code:
my $digit = 12;
if ($digit =~ /\d/) {
print ("match\n");
} else {
print ("not match\n");
}
This prints match, although it should'nt cuz I have 2 digits. But if I change it to \d\d\d, it prints
not match. As it should. The point is that I want to match exactly 1 digit, not 1 or more.
Not sure whats wrong. Any ideas?