• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

Regular Expression Validation for Complex Passwords

Hi All,

Could anyone provide me with the regexp validation for the following string criterion:

Must be min of 10 characters; and
Must include 3 of the 4 character types -
    Upper case letters
    Lower case letters
    numerals
    special characters

Many thanks,

Rit
0
rito1
Asked:
rito1
1 Solution
 
Dennis AriesCEO @ Arkro ITCommented:
Nilang Shah has an example of almost exactly your question. He expects all four types to be present.

You can extend this expression using the 'or'-sign (|) to combine the separate expressions that include 3 of the 4 types.

Something like this will do :)


^.*(?=.{10,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$|^.*(?=.{10,})(?=.*\d)(?=.*[A-Z])(?=.*[@#$%^&+=]).*$|^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[@#$%^&+=]).*$|^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$
0
 
rito1Author Commented:
Excellent, thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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