def extract_numbers(string):
    """Extract numbers (int, float) from a given string."""
    pattern = r"[-+]?\d*\.\d+|\d+"
    matches = re.findall(pattern, string)
    numbers = [float(match) if "." in match else int(match) for match in matches]
    return numbers
Extract numbers (int, float) from a given string.
smoe/utils/operations/operation_string.py