Commit bdb304fa by 朱亚东

添加密码校验方法

parent 06502b80
......@@ -111,6 +111,22 @@ public final class RegexUtils {
return m.find();
}
/**
* 判断密码是否符合标准:规则:6-16位必须是大写字母开头含有数字,不能有特殊字符的密码
* @param str
* @return boolean true,通过,false,没通过
*/
public static boolean isStandarPassword(String str) {
if (null == str || "".equals(str)) {
return false;
}
String pattern = "^[A-Z](?=.*[0-9].*)[A-Za-z0-9]{5,15}$";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(str);
return m.matches();
}
public static void main(String[] args) {
boolean mobileNO = isMobileNO("16603042204");
System.out.println(mobileNO);
......
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