Commit 22578fa0 by 朱亚东

修改密码校验规则

parent bdb304fa
...@@ -97,7 +97,6 @@ public final class RegexUtils { ...@@ -97,7 +97,6 @@ public final class RegexUtils {
return ip.matches(regex); return ip.matches(regex);
} }
/** /**
* 判断是否含有中文,仅适合中国汉字,不包括标点 * 判断是否含有中文,仅适合中国汉字,不包括标点
* @param text * @param text
...@@ -112,7 +111,7 @@ public final class RegexUtils { ...@@ -112,7 +111,7 @@ public final class RegexUtils {
} }
/** /**
* 判断密码是否符合标准:规则:6-16位必须是大写字母开头含有数字,不能有特殊字符的密码 * 判断密码是否符合标准:规则:6-16位数字和字母组合,不能有特殊字符的密码
* @param str * @param str
* @return boolean true,通过,false,没通过 * @return boolean true,通过,false,没通过
*/ */
...@@ -121,7 +120,7 @@ public final class RegexUtils { ...@@ -121,7 +120,7 @@ public final class RegexUtils {
return false; return false;
} }
String pattern = "^[A-Z](?=.*[0-9].*)[A-Za-z0-9]{5,15}$"; String pattern = "^(?=.*[0-9].*)(?=.*[a-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