>至少包含8个字符.
>包含大写和小写字母.
>包含数字或其他非字母字符.
>包含大写和小写字母.
>包含数字或其他非字母字符.
上述标准可以是什么?
我正在创建一个更强密码的检查:)
c#我正在使用
这应该这样做:
(?=.*?[a-z])(?=.*?[A-Z])(?=.*?[^a-zA-Z]).{8,}
见:rubular
解释:
(?=.*?[a-z]) //lookahead,there has to be a lower case alphabetic char (?=.*?[A-Z]) //lookahead,there has to be a upper case alphabetic char (?=.*?[^a-zA-Z]) //lookahead,there has to be a non-alphabetic char .{8,} // any character at least 8 times