代码:

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

 

posted on 2018-12-29 17:26  月零Ray  阅读(374)  评论(0编辑  收藏  举报