Hello comrades!

There is a regular rule excluding this character set: *{}\/[]#@&<>

Here is the expression itself: /^(?!.*\{\}\\/\[\]#@&<>$)(.*)$/

It gives an error: Warning: preg_match (): Unknown modifier '\' in /path_to/index.php on line 485

Please tell me where this extra backslash.

  • replace the template delimiters, for example with tildes: ~^(?!.*\{\}\\/\[\]#@&<>$)(.*)$~ - Edward

1 answer 1

Swears on the slash in the center

I advise the site to check regular expressions https://regex101.com/

  • But backslash, what's all the same? :) - Linne
  • Which is marked in red) - Slava Podolskiy
  • But this is not a backslash and if you delete it, this “/” symbol will be missing - Linne
  • Try to screen him ^ (?!. * \ {\} \\ / [] # @ & <> $) (. *) $ - Slava Podolskiy