- or download this
if ($my_dat =~ /[^0-9]/) {
# $my_dat contains a non-digit.
...
}
- or download this
if ($my_dat =~ /^[0-9]+$/) {
# $my_dat only contains digits.
...
}
- or download this
if ($my_dat =~ /^[0-9]{2}$/) {
# $my_dat only contains digits.
# $my_dat is exactly two characters long.
...
}