import re


def is_doi(doi: str) -> bool:
    """
    check whether a string is a valid DOI
    :param doi: the string to be checked
    :return: True if a valid DOI, False otherwise
    """
    if type(doi) is not str:
        raise TypeError("The method only takes str as its input")
    # prefix suffix separated by /, so split and expect two elements
    parts = doi.split('/')
    if len(parts) != 2:
        return False
    # the number after "10." starts from 1000, so \d{4,}
    pattern = re.compile(r"^(doi:)?10\.(\d{4,})(\.\d+)?$")
    # group(1) could be None
    m = re.search(pattern, parts[0])
    if m:
        return True
    else:
        return False