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位‘
原文地址:https://www.cnblogs.com/majianyu/p/10198196.html
时间: 2024-10-06 14:15:24