Possible Duplicate:
How to detect a floating point number using a regular expression
How do I write a Python regular expression that matches string representations of floating point numbers?
The expression should match any string that is accepted by the float constructor as in float('3.5'). Thus the expression should match '0.' and '.0' but not '.'
There is no need to match string representations of infinity and NaN.
1 Answer