September 8th, 2010, 04:20 PM
Need RegEx expression for Strong password
I need RegEx expression for the following:
Passwords must be at least eight characters including at least one number and one special character (punctuation, symbol or upper/lower case character).
Note: The RegEx will be used in .NET
September 8th, 2010, 08:18 PM
1. This forum isn't some regex factory that pumps out regular expressions for anybody who comes back and asks.
2. Regular expressions aren't the tool for this.
3. Use String's .Length and .IndexOfAny() instead.
September 8th, 2010, 10:34 PM
I don't know .Net, but I agree that a single RegExp is definitely not the best way to do this.
September 9th, 2010, 12:21 PM
Thanks for your response. However, i am still not able to fullfil the upper/lower (alternate) case requirement. Here is the complete requirement (notice the last clause and example)
- All passwords must be 8 or more characters in length
- AND must include at least one numeric (0-9) character
- AND one punctuation mark OR alternate case (upper/lower) character (for e.g. Bluesky1 or bluEsky1 or green&1&).
Greatly appreciate your help.sorry if i was not clear earlier about the last clause.
September 9th, 2010, 07:34 PM
For the upper-/lowercase condition, check if the lowercase version of a string matches the original string. If so then everything was in lowercase; if not then something was not in lowercase.