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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -