import re


def valid_uniprot_ac_pattern(uniprot_ac):
    """
    Checks whether Uniprot AC is formally correct according to
    https://www.uniprot.org/help/accession_numbers 
    This is no check whether it actually exists.

    :param uniprot_ac:  Accession code to be checked

    """
    ac_pat = "[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}"
    if re.match(ac_pat, uniprot_ac):
        return True
    else:
        return False