jeudi 14 janvier 2016

Regex Validation in Laravel 5.2

Below is my rule for password:

return [
    'Password'                  => 'required|min:8|max:100|regex:[a-z{1}[A-Z]{1}[0-9]{1}]',
    'Password_confirmation'     => 'required|min:8|max:100|regex:[a-z{1}[A-Z]{1}[0-9]{1}]',
];

I am trying to add the rule such that it must have

  1. atleast one small char
  2. atleast one small char
  3. atleast one number
  4. atleast one special char
  5. min 8 chars

Above rule works for Point 5 only. Am I missing something ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire