Can anyone help me with a regex to allow atleast one special character, one uppercase, one lowercase.
This is what I have so far:
^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$
but it seems to match the characters only in the order “special character”, “uppercase”, “lowercase”.
Any help is greatly appreciated
Your regex
should actually work just fine, but you can make it a lot better by removing the first
.*:will match any string of at least 8 characters that contains at least one lowercase and one uppercase ASCII character and also at least one character from the set
@#$%^&+=(in any order).