Here is an example of a regular expression.

select NAME from table where NAME RLIKE '^тест$' 

But what if this very “test” is not known in advance and comes from a php form via AJAX? With the usual query using LIKE, everything is also extremely simple and clear, but what about in such a situation?
There was an idea to transform the resulting string into an array and work with each element, but the idea did not advance further.

  • And what is the difference between LIKE and RLIKE? and there, and there the pattern is a stupid string literal. - Akina
  • @Akina need to take into account the introduction when searching for punctuation marks, errors - Kirill Sawoyen
  • Why not just substitute the $_POST['field'] test instead? Where the field key in which the data is pushed before being sent. - wcobalt
  • Now I just compare the contents of the fields with the resulting $ text. - Kirill Sawoyen
  • @wcobalt is now implemented. However, I would like to implement the ability to search, for example, provided that the user has entered no "glue" and "adhesives". - Kirill Sawoyen

0