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
  • 732,580
  • 175
  • 1,330
  • 1,459
Sithu
  • 4,752
  • 9
  • 64
  • 110

1 Answers1

2

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

Sithu
  • 4,752
  • 9
  • 64
  • 110
kunicmarko20
  • 2,095
  • 2
  • 15
  • 25
  • 1
    Thanks. Here is my actual working condition `REGEXP(CONCAT(',', setColumn, ','), CONCAT(',(', comparedColumn, '),')) = 1` – Sithu Feb 25 '18 at 12:40