Link to home
Start Free TrialLog in
Avatar of smacca
smaccaFlag for Australia

asked on

Simple password letter/number regular expression.

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.
Avatar of Raynard7
Raynard7

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 / ?
Avatar of smacca

ASKER

thanks for getting back to us.

we just want a expression for numbers and letters .
we already have a regex for length.
ASKER CERTIFIED SOLUTION
Avatar of sumix
sumix

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can check the regex online http://mem9.net/dev/regextester.aspx
sumix's solution would fit your requirements properly.