import re


def increment_version(version):
    """
    Increment a Version Number
    >>> increment_version("0.0.3")
    '0.0.4'
    >>> increment_version("2.4-rc1")
    '2.4-rc2'
    >>> increment_version("2.4-alpha")
    Traceback (most recent call last):
        ...
    ValueError: version must end with a digit
    """
    match = re.search(r"\d+$", version)
    if match is None:
        raise ValueError("version must end with a digit")
    as_int = int(match.group())
    as_int += 1
    return re.sub(r"\d+$", str(as_int), version)