Check acronyms against regex.

    Normalize valid acronyms to upper-case.
    If an invalid acronym is encountered raise InvalidAcronymError.

def _sanitize_acronyms(unsafe_acronyms):
    """
    Check acronyms against regex.

    Normalize valid acronyms to upper-case.
    If an invalid acronym is encountered raise InvalidAcronymError.
    """
    valid_acronym = regex.compile(u'^[\p{Ll}\p{Lu}\p{Nd}]+$')
    acronyms = []
    for a in unsafe_acronyms:
        if valid_acronym.match(a):
            acronyms.append(a.upper())
        else:
            raise InvalidAcronymError(a)
    return acronyms