What regular expression can I use to allow characters like these @#%&-+()/*"':;!?~|{}[]_
in php?
What regular expression can I use to allow characters like these @#%&-+()/*"':;!?~|{}[]_
in php?
With this regular expression you are forced to:
The password must have between 8 and 16 characters, at least one digit, at least one lowercase, at least one uppercase and at least one non-alphanumeric character.
^(?=.*\d)(?=.*[\u0021-\u002b\u003c-\u0040])(?=.*[A-Z])(?=.*[a-z])\S{8,16}$
the code in PHP
if (preg_match('/^(?=.*\d)(?=.*[\u0021-\u002b\u003c-\u0040])(?=.*[A-Z])(?=.*[a-z])\S{8,16}$/', $cadenaok))
{
return true;
}