6-16位数字字母混合,不能全为数字,不能全为字母,首位不能为数字
public boolean isPassword(String password){
String regex="^(?![0-9])(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$";
Pattern p=Pattern.compile(regex);
Matcher m=p.matcher(password);
boolean isMatch=m.matches();
Log.i(TAG, "isPassword: 是否密码正则匹配"+isMatch);
return isMatch;
}
再附上手机号码格式验证(正则)
https://blog.youkuaiyun.com/YTYT5200/article/details/111993828