Re: RegularExpression Validation for password in ASP.NET
- From: RhythmAddict <sanjay.uttam@xxxxxxxxx>
- Date: Thu, 10 Apr 2008 15:19:45 -0700 (PDT)
On Apr 10, 3:24 pm, "bienwell" <bienw...@xxxxxxxxxxx> wrote:
Hi all,
Can any one help me to write a regular expression to validate the password
entered on the text field in ASP.NET. The rules for the password are:
1- There must be at least one number in the password.
2- There must be upper and lower case letters in the password.
3- Password must begin with an alphabetic character.
4- Password cannot contain illegal characters, such as =, <, >, ;, :, '
, " or comma (equal sign, greater sign, less than sign, semicolon, colon,
single quote, double quotes, comma).
5- Password must be between 8 and 25 characters.
I'm not good at writing the expression. Please help me out.
Thanks in advance.
RegularExpressions.Regex.IsMatch(lblYourPw, "(?!^[0-9]*$)(?!^[a-zA-Z]*
$)^([a-zA-Z0-9]{8,10})$"))
"Validates a strong password. It must be between 8 and 10 characters,
contain at least one digit and one alphabetic character, and must not
contain special characters" I think you're 90% of the way there (got
it from http://msdn2.microsoft.com/en-us/library/ms998267.aspx)
.
- Follow-Ups:
- Re: RegularExpression Validation for password in ASP.NET
- From: bienwell
- Re: RegularExpression Validation for password in ASP.NET
- References:
- RegularExpression Validation for password in ASP.NET
- From: bienwell
- RegularExpression Validation for password in ASP.NET
- Prev by Date: Re: can not get AJAX to work on sever, please help
- Next by Date: Re: Questions about credit card payment handling
- Previous by thread: RegularExpression Validation for password in ASP.NET
- Next by thread: Re: RegularExpression Validation for password in ASP.NET
- Index(es):
Relevant Pages
|
Loading