-2

I want to use regex to prohibit certain characters. This works. However, I cannot write superscripts, although they are allowed.

This is my regex:

    return [
       'name' => ['regex:/^[^\x27\x22\\@!$&§{\[\]}><;?]+$/']
    ];

I want to store name like "This is the nam 234³". But the "³" or "²" doesn't store.

  • I believe this is not a regex problem rather a database issue, check this out to see if it helps https://stackoverflow.com/questions/34653433/store-subscript-and-superscript-values-in-mysql – dz0nika Sep 05 '22 at 10:30
  • The Vaildate return false. Thats the Problem. Manually i can store in Database with this character. But the Laravel Validate does not match. It is not a Database problem. – TheTankFrank Sep 05 '22 at 11:07

1 Answers1

-1

OK, i detect the problem of my regex. I exclude the "Paragraph-Sign". This is the same key as "§".