0

I've a table like this,

values
-------------------
male,female
PHP 30
PHP (30)
PHP ($30),CSS ($20)
PHP {$30},CSS {$20}
PHP [$30],CSS [$20]
PHP (€30),CSS (20)

I've prepared the sql like this,

SELECT mytable.values FROM mytable WHERE mytable.values REGEXP '[[:<:]]PHP ($30)[[:>:]]'

It should match one row (4th), but it's not working.

It's also not working with () / {} / [] or any types of symbols like $ / €

I want to mention here that,

  1. MYSQL LIKE isn't the right thing for me I think, because it won't work if we want to match male.
  2. REGEXP is working for PHP 30 here and it's working for only strings.

Could anyone please inform me what will be the best solution to match the exact word or sentence?

Thanks in advance.

Encrypted
  • 628
  • 1
  • 10
  • 22

0 Answers0