in reply to dependable way to test for a float
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: dependable way to test for a float
by vindaloo (Acolyte) on May 05, 2005 at 00:05 UTC | |
by shemp (Deacon) on May 05, 2005 at 16:50 UTC |