You can help me with this problem that I have, I would like to validate a password with specific requirements, which are: - It must contain a number, a capital letter and a special character. It must also be between 8 and 12 characters. Make the following pattern:
$special_chars = '!@#$%^&*()';
$pattern = "/[A-Z0-9{$special_chars}]{8,12}/";
$password = '$dsd%FG23X';
preg_match($pattern, $password, $matches);
But it does not work and I need to know what the correct pattern would be.
Aucun commentaire:
Enregistrer un commentaire