$string1 = "99 bottles of beer on the wall.";
if ($string1 =~ m/(\d+)/) {
print "$1 is the first number in '$string1'\n";
}
'''Output:'''
99 is the first number in '<tt>99 bottles of beer on the wall.</tt>'

\D

Matches a non-digit.

$string1 = "Hello World\n";
if ($string1 =~ m/\D/) {
print "There is at least one character in $string1";
print "that is not a digit.\n";
}