jeudi 2 novembre 2017

Laravel variable validation regex pattern not working

Laravel variable validation regex pattern not working. Help me please

$variable = "(222) 111-2233";
$fileArray = array('variable' => $variable);
$rules = array('variable' => 'regex:/([(])([0-9])([0-9])([0-9])([)]) ([0-9])([0-9])([0-9])-([0-9])([0-9])([0-9])([0-9])/');
$validator = Validator::make($fileArray, $rules);
if ($validator->fails()){ echo 'fail'; } else { echo 'yes'; }

Return fail :(



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lGWVsL
via IFTTT

Aucun commentaire:

Enregistrer un commentaire