I have a requirement where i used regular expression in asp.net application which will validate the password entered by the user based on some conditions.
1) Minimum password length should be 8.
2) Must contain alphanumeric with minimum 3 numerics (numerics can be anywhere in the string like 1bc23ef#@,123@abcd,abcd!@123).
I have used the below expression
^.*(?=.{8,})(?=.*[a-zA-Z0-9])(?=.*\d{3}).*$
bt it fails as it is accepts the below pattern
1) 123456789
it does not accept if i enter the password as abc1ef32!@
but works if i give as 123@abcd or abcd!@#123
any help is highly appreciated.
Abhimanyu K VatsaPosted Jun 4, 2010, 4:42 AM
I think you are intermediate......
There are lots of ways to handle the password complexity in ASP.Net, as i have posted an article about, you can read it.
Here it is Article by Abhimanyu
I hope my article will help you.
Accept my answer.
Good Luck and have a happy coding !