import re


def string_to_float(s: str) -> float:
    """
    Double precision float in Fortran file will have form 'x.ydz' or 'x.yDz', this cannot be convert directly to float
    by Python ``float`` function, so I wrote this function to help conversion. For example,

    :param s: a string denoting a double precision number
    :return: a Python floating point number

    .. doctest::

        >>> string_to_float('1d-82')
        1e-82
        >>> string_to_float('-1.0D-82')
        -1e-82
        >>> string_to_float('+0.8D234')
        8e+233
        >>> string_to_float('.8d234')
        8e+233
        >>> string_to_float('+1.0D-5')
        1e-05
        >>> string_to_float('-0.00001')
        -1e-05
        >>> string_to_float('.8e234')
        8e+233
        >>> string_to_float('.1')
        0.1
    """
    return float(re.sub('d', 'e', s, flags=re.IGNORECASE))