[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Password reg ex.

Hi All,

I see pleanty of password reg ex, but nothing quite what I need.

Min chars = 6
Max Chars = 12
Must have at least One Number
Must Have at leat One capital letter
Only Letters and numbers allowed but can have Spanish characters. Is it posible to have a locale setting. For example the following chars (Ññ,ÁáÉé) etc.

Any ideas?

A.
0
Abiel de Groot
Asked:
Abiel de Groot
1 Solution
 
raterusCommented:
I'm assuming you are using the logic on a password screen.  Without working into a fancy Regular Expression, that I don't even know how to create for you.  Have you tried keeping it simple and using a few combined regular expressions to create the final validation?

For instance, you have a RegExValidator that validates the size, another validates that it has one number, another validates it has one capital letter, etc.  The final result will be 4-5 regexvalidators, but it'll be much simpler to debug, and you can give the user a specific error message of what their password doesn't have.
0
 
Abiel de GrootAuthor Commented:
You logic makes good sense. Will try as you suggest.

Many thanks

A.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now