My password validation criteria is as follows:
- Must contain at least two lower case characters
- Must contain at least two upper case characters
- Must contain at least two numeric characters
- Must contain at least two special characters i.e. @#$%
- Must be at least 11 characters long
I tried using this for the first four criteria:
/(?:\d{2,})(?:[a-z]{2,})(?:[A-Z]{2,})(?:[!"'#$&()*+-@,.:;<>=?^_`{|}~\/\\]{2,})/g
But it does not match the following string which i would expect it to:
12QAqa@#
But it does match:
12qaQA@#
The order that the validation criteria is not important. How do i rewrite the regex to not take into account the order?