Re: RegularExpression Validation for password in ASP.NET



I'm not a regex expert either, but based on the previous post, this
seems to work:

Regex.IsMatch(
input, "(?!^[0-9]*$)(?!^[a-z]*$)(?!^[A-Z]*$)(?!^[a-z0-9]*$)(?!^[A-
Z0-9]*$)^([a-zA-Z][a-zA-Z0-9]{8,25})$")
)

============
Regards,
Steve
www.stkomp.com

bienwell 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.
.



Relevant Pages

  • Re: RegularExpression Validation for password in ASP.NET
    ... Can any one help me to write a regular expression to validate the ... 3- Password must begin with an alphabetic character. ... single quote, double quotes, comma). ...
    (microsoft.public.dotnet.framework.aspnet)
  • 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)
  • attn: regex gurus. can this be done with a regular expression or using a different technique?
    ... I need to switch *whatever* appears before the comma with ... *whatever* appears after the comma. ... If this code revision is not possible with a regular expression, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how do I extract the ID name of a Div and its content?
    ... got closest to what you were trying, ... example, you might be using the Hpricot (HTML parsing) library, or REXML ... a regular expression which matches a single quote followed by any number ... of non-single-quote characters followed by a single quote. ...
    (comp.lang.ruby)
  • Re: Regular Expression Help
    ... | I need to find all occurrences of a comma in a string EXCEPT where it ... | I figured a regular expression would be the way to go, ... | Kind of like the wizard that helps you build a connection string? ... | of various RegEx test programs, but I would like one to help me construct ...
    (microsoft.public.dotnet.languages.vb)