numeric_const_pattern = """
    [-+]? 
    (?:
        (?: \\d* \\. \\d+ ) 
        |
        (?: \\d+ \\.? ) 
    )
    (?: [Ee] [+-]? \\d+ ) ?
    """
rx = re.compile(numeric_const_pattern, re.VERBOSE)
rx.findall('.1 .12 9.1 98.1 1. 12. 1 12')
rx.findall('-1 +1 2e9 +2E+09 -2e-9')
rx.findall('current level: -2.03e+99db')
How to extract a floating number from a string