Working on code similar to this previous post but for passwords ($email is now $password). Trying have validation check to see if password field has at least one number, one lowercase letter, one uppercase letter, and one of the symbols !@#$%^&*
PHP-side validation uses regex
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*])[a-zA-Z\d!@#$%^&*]{6,20}$/
which works fine. However for js validation I'm using this for "if password does not contain one of each"
if (preg_match('/([^a-z]{1})([^A-Z]{1})(^\d{1})([^!@#$%^&*]{1})+/', $password, $matches)) {
echo 'Password must contain _, _, _';
Total beginner and very confused.