import re


def parse_value(value):
    """Parse the string to find the value, supports LTSpice syntax for suffixes."""

    split = re.split("([a-z]+)", value.lower())  # regex magic

    if len(split) == 1 or split[1] == "e":  # no suffix or exponent notation
        return float(value)

    suffix = split[1].lower()
    if suffix.startswith("k"):  # kilo
        return float(split[0]) * 1e3
    elif suffix.startswith("meg"):  # mega
        return float(split[0]) * 1e6
    elif suffix.startswith("g"):  # giga
        return float(split[0]) * 1e9
    elif suffix.startswith("t"):  # tera
        return float(split[0]) * 1e12
    elif suffix.startswith("f"):  # femto
        return float(split[0]) * 1e-15
    elif suffix.startswith("p"):  # pico
        return float(split[0]) * 1e-12
    elif suffix.startswith("n"):  # nano
        return float(split[0]) * 1e-9
    elif suffix.startswith("u") or suffix.startswith("micro"):
        return float(split[0]) * 1e-6
    elif suffix.startswith("m"):  # milli
        return float(split[0]) * 1e-3