标签:pat pattern pass div 包含 数字 判断 class 判断字符串
def judge_password(password): if len(password) >= 8: pattern = re.compile(‘[A-Z]+‘) match = pattern.findall(password) if match: pattern = re.compile(‘[a-z]+‘) match = pattern.findall(password) if match: pattern = re.compile(‘[0-9]+‘) match = pattern.findall(password) if match: return ‘True‘ else: return ‘必须包含数字‘ else: return ‘必须包含小写字母‘ else: return ‘必须包含大写字母‘ else: return ‘长度必须大于8位‘
标签:pat pattern pass div 包含 数字 判断 class 判断字符串
原文地址:https://www.cnblogs.com/majianyu/p/10198196.html