android 检测输入密码是否符合规范 /* 8~16位数字和字母组成/* 不能是纯数字或纯字母

时间:2021-06-01 19:17:32   收藏:0   阅读:22
/**
     * 检测输入密码是否符合规范
     * 8~16位数字和字母组成
     * 不能是纯数字或纯字母
     */
    public static boolean isPasswordForm(String pwd) {
        if (TextUtils.isEmpty(pwd)) return false;
        String regex = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$";
        return pwd.matches(regex);
    }

?

原文:https://blog.51cto.com/u_4955660/2842803

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!