Try to use this regex:
^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+*!=]).*$ Explanation:
(/^ (?=.{8,}) //should be 8 characters or more (?=.*[a-z]) //should contain at least one lower case (?=.*[A-Z]) //should contain at least one upper case (?=.*[@#$%^&+*!=]) //should contain at least 1 special characters .*$/)