Search code examples
mysqlregex

mysql update with regexp


I want to remove something from my table 1) 32) 121) 1000)... the format is number + )

I tried this code.

UPDATE articles SET 
title= REPLACE(title,'\d)', '' ) 
WHERE title regexp "\d)*"

Nothing happened in phpmyadmin, how to write correct? Thanks.


Solution

  • You can't: Mysql doesn't support regex-based replace.

    See this SO question for a work-around.