I am trying to establish password parameters to be 8-20 characters long, at least one upper case character, number, and symbol. I have written the code as such
(preg_match ('/^(\W+)(\d+)([A-Z]+)([a-z]+){8,20}$/', $_POST['pass1']) )
My interpretation of my code is as follows:
W+ one or more symbols (non alpha numeric)
d+ one or more numbers
[A-Z]+ one or more uppercase characters
[a-z]+ one or more lower case characters
{8,20} string length min 8 max 20
When I enter the password as Anyhelp4me! I get an invalid password message. What are your suggestions.