What regular expression would I use for checking if a string contains at least 1 uppercase letter, 1 lowercase letter, a symbol, and a number? I am using PHP and JavaScript.
This should do what you need:
preg_match('/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).+$/', $string);
(preg_match("/^.(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$/", $_POST["string"])
i hope this works