php - Preg_match for password always errors -
i'm using password needs 8-20 chars long, numbers, letters , !@#$% symbols:
if (!preg_match('/^(?=.*\d)(?=.*[a-za-z])[0-9a-za-z!@#$%]{8, 20}$/', $_post['password'])) { $errors[] = true; $_session['error'] .= '<div class="messages status_red">password must 8-20 long, a-z, 0-9, !@#$% only.</div>'; }
however no matter if meet criteria or not still return error.
i don't see error_reporting messages either.
any idea reason this?
don't put space in {8, 20}
. should {8,20}
.
Comments
Post a Comment