测测你的密码需要多久被破译!密码强弱度的正则判断
2011-09-14 23:06
316 查看
http://howsecureismypassword.net/
public static int parsePassword(String password) { int result = 0; Pattern ps = Pattern .compile("[a-zA-Z0-9_\\,\\.\\-\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\+]{6,16}"); Pattern lower = Pattern.compile("[a-z]"); Matcher mlower = lower.matcher(password); Pattern upper = Pattern.compile("[A-Z]"); Matcher mupper = upper.matcher(password); Pattern special = Pattern .compile("[_\\,\\.\\-\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\+]"); Matcher mspecial = special.matcher(password); if (ps.matcher(password).matches()) { if (mspecial.find()) { result = 3; } else if (mupper.find()) { result = 2; } else if (mlower.find()) { result = 1; } } return result; }
相关文章推荐
- 判断 网络地址 是否合法的正则,需要的可以参考下,支持IPV6格式的判断
- iOS_正则表达式判断邮箱、手机号、身份证、昵称、密码等
- Android 如何判断wifi热点是否需要密码
- 201_用正则来判断密码强度过低
- iOS_正则表达式判断邮箱、手机号、身份证、昵称、密码等
- 正则表达式判断手机号、邮箱、身份证号码、密码、Url、邮编等工具类
- 用正则判断密码是否正确
- 【RegExp】利用正则进行需要整除操作的判断,如:奇偶性,质数合数
- 用正则表达式来判断是否有需要的字符串
- JS利用正则表达式实现简单的密码强弱判断实例
- iOS - 正则表达式判断邮箱、手机号码验证、车牌号验证、车型、用户名、密码、昵称、身份证号
- iphone开发 用正则判断邮箱、密码是否正确
- Java - 华为机试训练 - 密码验证合格程序(正则表达式判断)
- 用户名密码正则判断
- iphone开发 用正则判断邮箱、密码是否正确
- iphone开发用正则判断邮箱、密码是…
- Android(Java)正则表达式判断手机号、邮箱、身份证号码、密码、Url、邮编等工具类
- iOS_正则表达式判断手机型号、邮箱、手机号、身份证、昵称、密码等
- 正则判断账号密码(指定数字,字母,位数)
- iOS_正则表达式判断手机型号、邮箱、手机号、身份证、昵称、密码等