sub isThisADecimalNumber { my ($string) = @_; return $string =~ /^\s* -? # negative sign - optional (?: \d+ # digits (?:\.\d*)? # and an optional decimal and +maybe more digits | # OR \.\d+ # a decimal and some digits ) \s*$/x; }
In reply to Re: dependable way to test for a float
by shemp
in thread dependable way to test for a float
by vindaloo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |