正则表达式:必须要有一个小写字母,一个大写字母和一个数字,并且是8-16位

public static boolean isMobileNO(String mobiles) {
    Pattern pattern = Pattern.compile("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[A-Za-z0-9]{8,16}$");
    Matcher matcher = pattern.matcher(mobiles);
    boolean b = matcher.matches();
    return b;

}

猜你喜欢

转载自blog.csdn.net/qq_35841348/article/details/80735251
今日推荐