I have a title column which contains some words within brackets. I would like to remove the brackets but keep the words which are currently inside them by using regexp_replace. I tried this but it didn't seem to work. There is still brackets in the column.
UPDATE test_table SET title = regexp_replace(title, '()', '', 'g');
Not tested, but assuming that this is regular regex syntax.
UPDATE test_table SET title = regexp_replace(title, '\(|\)', '', 'g');
or
UPDATE test_table SET title = regexp_replace(title, '[()]', '', 'g');
Putting the () into []
means to look for each single character. Using the |
means "or", but you need to \
escape the () in that case.