if($input =~ /^(-?)((0|\d+).)?\d+$/) { print ("Yes, it is a number\n"); }