regex to allow atleast one special character, one uppercase, one lowercase(in any order)

regex

Solution

Your regex

^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$

should actually work just fine, but you can make it a lot better by removing the first `.*`:

^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$

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).

Problem

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

Original source