判断密码是否包含数字和字母

代码:

String regex = "^(?!([a-zA-Z]+|\\d+)$)[a-zA-Z\\d]{6,20}$";
String a = "a11111111a";
boolean matches = a.matches(regex);
System.out.println(matches);

猜你喜欢

转载自blog.csdn.net/weixin_42402763/article/details/85342127