def validate_conan_name(name):
    """Check for name compliance with pattern rules"""
    try:
        if name == '*' and ConanFileReference.wildcard_is_allowed:
            return name
        if ConanFileReference.validation_pattern.match(name) is None:
            if len(name) > ConanFileReference.max_chars:
                message = "'%s' is too long. Valid names must " \
                          "contain at most %s characters." % (name,
                                                              ConanFileReference.max_chars)
            elif len(name) < ConanFileReference.min_chars:
                message = "'%s' is too short. Valid names must contain"\
                          " at least %s characters." % (name, ConanFileReference.min_chars)
            else:
                message = "'%s' is an invalid name. Valid names MUST begin with a "\
                          "letter or number, have between %s-%s chars, including "\
                          "letters, numbers, underscore,"\
                          " dot and dash" % (name, ConanFileReference.min_chars,
                                             ConanFileReference.max_chars)
            raise InvalidNameException(message)
        return name
    except AttributeError:
        raise InvalidNameException('Empty name provided', None)
dataset/ETHPy150Open conan-io/conan/conans/model/ref.py/validate_conan_name/original