in reply to How to identify a number datatype in a string?

The Perl Cookbook suggests that the following regex will match C floats: $var =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d)?([Ee]([+-]?\d+))?$/; That may be overkill for your purposes, though.

Update: (Tue Jan 8 16:03:52 UTC 2002) Removed spurious left paren (thanks, Petruchio).