Commit cb48a1e1 by 朱亚东

修改密码校验规则,必须包含字母(可以是大写或是小写)和数字

parent 22578fa0
...@@ -120,7 +120,7 @@ public final class RegexUtils { ...@@ -120,7 +120,7 @@ public final class RegexUtils {
return false; return false;
} }
String pattern = "^(?=.*[0-9].*)(?=.*[a-z].*)[A-Za-z0-9]{6,16}$"; String pattern = "^(?=.*[0-9].*)(?=.*[A-Za-z].*)[A-Za-z0-9]{6,16}$";
Pattern r = Pattern.compile(pattern); Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(str); Matcher m = r.matcher(str);
return m.matches(); return m.matches();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment