import repassword = raw_input("Enter string to test: ")if re.fullmatch(r'[A-Za-z0-9@#$%^&+=]{8,}', password): # matchelse: # no match的
{8,}意思是“至少8”。该.fullmatch函数要求整个字符串匹配整个正则表达式,而不仅仅是一部分。

import repassword = raw_input("Enter string to test: ")if re.fullmatch(r'[A-Za-z0-9@#$%^&+=]{8,}', password): # matchelse: # no match的
{8,}意思是“至少8”。该.fullmatch函数要求整个字符串匹配整个正则表达式,而不仅仅是一部分。