def METHOD_NAME(username):
    """Removes any invalid characters from the username"""
    regex = compile(UnicodeUsernameValidator.regex)
    normalized_username = ""
    for char in username:
        if not regex.match(char):
            continue
        normalized_username += char
    return normalized_username