Yes, Regex.. everyone's most feared topic. I hope some brave soul can help.
Trying for password validation, numbers and letters only allowed and 8-12 characters. I have tried hundreds of combinations, the one below is the closest I have gotten. The issue is anything under 8 doesn't work but everything over 12 still does for some reason.
/(\d|[a-z]){8,12}/
also tried: (same results)
/\d|[a-z]{8,12}/
Anyone know why the 12 isn't registering?
// password validator
$passpattern = "/(\d|[a-z]){8,12}/";
if(!preg_match($passpattern, $_POST['pass'])) {
header("location:add.php?errorcode=5");
die('');
}