I want to extract numbers(integers and float) from a file(exclude all special symbols and alphabets). Numbers from all positions.
import re file = open(\'input_f
re.findall("[+-]?\d+\.?\d*",some_text)
I think at least
[+-]? zero or one of either + or - (ie optional)
[+-]?
\d+ one or more digits
\d+
\.? optionally a decimal
\.?
\d* zero or more additional numbers
\d*