I have this SQL query:
SELECT * FROM pages WHERE page_title = 'paul_mccartney'
But often in page_title
the value is like 'paul_mccartney (musician)
'. And in this case I get NULL
back. I had the idea to regex replace everything which is between (
and )
including the ()
:
SELECT * FROM pages WHERE REPLACE(REGEXP('/\([^\*].*\)/U'), '', page_title) = 'paul_mccartney'
But it doesn't work. Is my idea possible or not? And how?