There is a basket. When adding goods to the cart, the name of the goods is checked regularly. If it fits, it is added. But the product name KONOV BC \ BD 768 is not added, because there is \ . Here's the regular expression pattern var $product_name_rules = '\.\:\-_ a-z0-9а-яА-Я()-,.!&'; How to add \

  • 2
    Possible duplicate question: The correct regular expression - Darth
  • There should be two backslashes in the regular season itself, but php requires each of them to be escaped - and four additions - Mike

1 answer 1

You must add a screened \, that is, "\\"

 $product_name_rules = '\\\.\:\-_ a-z0-9а-яА-Я()-,.!&';