Password Validation

R

Ron

Hi,
I need a regular expression for a login control i am using.
It needs to validate a minimum password length of 8.
Must consist of 1 upper case character and 1 numeric character and no
non-alphanumeric characters.

Can some one please show me an example.
I tried the following but have had no luck.

ValidationExpression="\[A-Z]{1,}\[a-z]{6,}\d{1,}"
ValidationExpression="\[A-Z]{1,}\w{6,}\d{1,}"


Thanks,
Ron
 
P

PeterKellner

Hi,
I need a regular expression for a login control i am using.
It needs to validate a minimum password length of 8.
Must consist of 1 upper case character and 1 numeric character and no
non-alphanumeric characters.

Can some one please show me an example.
I tried the following but have had no luck.

ValidationExpression="\[A-Z]{1,}\[a-z]{6,}\d{1,}"
ValidationExpression="\[A-Z]{1,}\w{6,}\d{1,}"


Thanks,
Ron

I'm not a regular expression Guru, but the one I use seems to work.

<asp:RegularExpressionValidator ID="RegularExpressionValidatorEmail"
ControlToValidate="Email"
Display="None"
EnableClientScript="false"
ValidationExpression="^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$"
ErrorMessage="Email Must Be In (e-mail address removed) format" runat="server"
ValidationGroup="group1" >
Peter Kellner
http://peterkellner.net
 
J

Jeff Grossman

What character set do you really care about? None of this
will work in a full Unicode envornment. If fact, it won't
even work for for the Latin-1 character set. If you need,
I can post some full Unicode code.

Gaurav Vaish (EduJini.IN) said:
ValidationExpression="^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$"

No. It doesn't work for his requirement... one upper case, one lowercase and
one number (minimum)

Not quite sure... but regex seems kind of impossible coz we need to
backtrack if one character from the set has been used... not of the exact
character.

--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top