import re


def extract_number_from_string(target_str):
    """Extract number from string.

    Args:
        target_str (str): containing number in string format.

    Returns:
        float: parsed from string.
    """
    number_pattern = '(\\-?[0-9]+(\\.[0-9]+)?)'
    matches = re.search(number_pattern, target_str)
    if matches:
        return float(matches.group(0))
    else:
        raise ValueError(f"ERROR: Bad number passing. Could not parse {target_str}.")