from typing import OrderedDict


def parse_re(input, target_re):
    """
    Run re.findall with `target_re` regexp on given `input`

    Return found targets as OrderedDict with float values.

    parse_re("G0 S3 P0.1") = {'S': 3, 'P': 0.1}

    """
    x = input.strip()
    res = target_re.findall(x)
    return OrderedDict(map(lambda x: (x[0], float(x[1])), res))