We help IT Professionals succeed at work.

Simple password letter/number regular expression.

smacca
smacca asked
on
320 Views
Last Modified: 2007-11-27
Hi,

I am looking for help as to why this reg. ex does not behave as expected:


     ValidationExpression="[a-zA-Z]+\w*\d+\w*"


We would like a regex that allows a password like "9sj4n3xa65aa" to pass ok!

Would love your help.

Cheers.
Comment
Watch Question

Top Expert 2006

Commented:
the \w is looking for new words (separated by spaces) additionally the first character must be alpha - hence this is failing.

what requirements do you have exactly - ie must contain numbers and letters? / be a certain length / ?

Author

Commented:
thanks for getting back to us.

we just want a expression for numbers and letters .
we already have a regex for length.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
You can check the regex online http://mem9.net/dev/regextester.aspx
Top Expert 2006

Commented:
sumix's solution would fit your requirements properly.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.