Forum Moderators: coopster
^(([A-Za-z]+[^0-9]*)([0-9]+[^\W]*)([\W]+[\W0-9A-Za-z]*))¦
(([A-Za-z]+[^\W]*)([\W]+[^0-9]*)([0-9]+[\W0-9A-Za-z]*))¦
(([\W]+[^A-Za-z]*)([A-Za-z]+[^0-9]*)([0-9]+[\W0-9A-Za-z]*))¦
(([\W]+[^0-9]*)([0-9]+[^A-Za-z]*)([A-Za-z]+[\W0-9A-Za-z]*))¦
(([0-9]+[^A-Za-z]*)([A-Za-z]+[^\W]*)([\W]+[\W0-9A-Za-z]*))¦
(([0-9]+[^\W]*)([\W]+[^A-Za-z]*)([A-Za-z]+[\W0-9A-Za-z]*))$
Iv broken it at the pipes but it should be all on one line.
function check_password($string) {
if(preg_match("/[a-z]/",$string) && preg_match("/[A-Z]/",$string) && preg_match("/[0-9]/",$string) && preg_match("/[,.?!;:]/",$string)) {
return 1;
} else {
return 0;
}
}
A little more function calls but easier to see.