Re: RegularExpression Validation for password in ASP.NET



Thanks fyi.

"RhythmAddict" <sanjay.uttam@xxxxxxxxx> wrote in message
news:61ef59f1-90bb-45a3-a5db-2d100a903662@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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)


.



Relevant Pages

  • Re: RegularExpression Validation for password in ASP.NET
    ... Can any one help me to write a regular expression to validate the password ... single quote, double quotes, comma). ... 5- Password must be between 8 and 25 characters. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: regular expression no match on set if subset matches
    ... Dave wrote: ... > I am trying to define a regular expression to validate a password ... > characters except in the one special case where it has the format ...
    (comp.lang.perl.misc)
  • Problem with regular expression
    ... I'm trying to validate a password by means of a regular expression. ... guarantee that the password length is between 4 and 8 characters and that it ...
    (microsoft.public.dotnet.languages.csharp)
  • RegularExpression Validation for password in ASP.NET
    ... Can any one help me to write a regular expression to validate the password ... 3- Password must begin with an alphabetic character. ... single quote, double quotes, comma). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Regular Expressions
    ... I am trying to work out a regular expression which will validate a ... No special characters allowed except for full stop. ... Ros Lee ...
    (microsoft.public.dotnet.general)