I'm trying to create a regular expression that validates following conditions
- Min * length
- Min * lower case
- Min * upper case
- Min * special characters
I already have this
^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\S+$).{8,}$
^(?=.*[0-9]) // At least 1 digits
(?=.*[a-z]) // At least 1 lower case
(?=.*[A-Z]) // At least 1 upper case
(?=.*[@#$%^&+=]) // At least 1 special character
.{8,}$ // length 8
The problem is that I need to validate at least 3 digits/lower/upper on any place on the string.
What do I have to add to my RE to make it possible? I was trying to use (?=.*[a-z]{3,})
but that only allows consecutive lower case char...