密码的正则表达式 [英] Regular Expressions for password

查看:106
本文介绍了密码的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从后面的代码中设计可配置的密码规则.
1个大写字母+ 1个数字+ 1个特殊字符,长度为8到12

I want to design configurable password rules from code behind.
1 caps + 1 numeric + 1 Special and length 8 to 12

推荐答案

您需要熟悉Regex.从这里开始:

30分钟正则表达式教程 [
You need to brush up on Regex. start from here:

The 30 Minute Regex Tutorial[^]

hope it helps :)


请参考以下线程:
密码必须为8个字符,包括1个大写字母1个特殊字符 [ ^ ]
http://stackoverflow.com/questions/5859632/regular-expression-for-password-validation [ ^ ]
Please refer following threads:
Password must be 8 characters including 1uppercase letter 1special character[^]
http://stackoverflow.com/questions/5859632/regular-expression-for-password-validation[^]


public static bool IsValidPassword (string input)
        {
Match match = Regex.Match(input, @"(?=^.{8,12}


这篇关于密码的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆