0

I don't know why am receiving a:

No ending delimiter '/' found`

Here is a live sample

Here is my regex validations

$validation = Validator::make($request->all(), [
    'cpf' => 'required|regex:/[0-9]{11}/',
    'identidade' => 'required|regex:/[0-9]{6,11}/'
]);

This one regex:/[0-9]{11}/ is working fine;

But when I put a min delimiter regex:/[0-9]{6,11}/ I get the error.

Anyone know why?

Community
  • 1
  • 1
Jhonatan Morais
  • 169
  • 1
  • 14

1 Answers1

0

Which version of Laravel are you using? I'm using 5.8 and it is working fine.

But you can also try to use an array for the rules:

$validation = Validator::make($request->all(), [
   'cpf' => ['required', 'regex:/[0-9]{11}/'],
   'identidade' => ['required', 'regex:/[0-9]{6,11}/']
]);
Diogo Gomes
  • 2,135
  • 16
  • 13