密码正则

public static boolean isPwd(String pwd) {
        if (isNull(pwd) || pwd.contains(" "))
            return false;
        return Pattern.matches("^[\u0021-\u007E]{4,16}$", pwd.trim());
    }

不包含汉字,21-7E是ASCII表的范围

猜你喜欢

转载自blog.csdn.net/buyaoshitududongwo/article/details/84634355