import re


def scrub_pmid(value):
    """
    Minimal cleanup on incoming PMIDs for validation.
    http://www.nlm.nih.gov/bsd/mms/medlineelements.html#pmid
    """
    if value.startswith("PMC"):
        return None
    match = re.findall(r'([1-9]{1}\d{2,7})', value)
    try:
        v = match[0]
    except IndexError:
        return None
    #Don't allow 0 to be returned.
    if v == 0:
        return None
    return v