0

I'm trying REGEXP in Doctrine for such condition WHERE CONCAT(",", setcolumn, ",") REGEXP ",(val1|val2|val3)," found at https://stackoverflow.com/a/26195280/1179841. I have added this in config.yml

orm:
    dql:
      string_functions:
        regexp: DoctrineExtensions\Query\Mysql\Regexp

However I still getting the error:

[2/2] QueryException: [Syntax Error] line 0, col 790: Error: Expected =, <, <=, <>, >, >=, !=, got 'REGEXP'

I use "beberlei/DoctrineExtensions": "1.0.*" in composer.json. Any idea?

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Sithu
  • 4,504
  • 9
  • 60
  • 107

1 Answers1

2

You use it like WHERE REGEXP(CONCAT(",", setcolumn, ","), ",(val1|val2|val3),") = 1

Sithu
  • 4,504
  • 9
  • 60
  • 107
kunicmarko20
  • 2,045
  • 2
  • 14
  • 25
  • 1
    Thanks. Here is my actual working condition `REGEXP(CONCAT(',', setColumn, ','), CONCAT(',(', comparedColumn, '),')) = 1` – Sithu Feb 25 '18 at 12:40