def is_valid_uid ( uid ) : pattern = r'^[A-Za-z][A-Za-z0-9]{10}$' if not isinstance ( uid , string_types ) : return False return bool ( re . compile ( pattern ) . match ( uid ) )
invalid character in identifier except python
: return : True if it is a valid DHIS2 UID False if not
def is_valid_uid(uid):
    """
    :return: True if it is a valid DHIS2 UID, False if not
    """
    pattern = r'^[A-Za-z][A-Za-z0-9]{10}$'
    if not isinstance(uid, string_types):
        return False
    return bool(re.compile(pattern).match(uid))