0

I have fields that contain the character *. I've been trying to remove them but my commands fail with an error...

Example:

UPDATE name SET name = REGEXP_REPLACE (name, '*', '') WHERE category_id = 168;

I'm also struggling to remove other characters like |

3
  • * has a special meaning in regular expression language (zero or more occurrences). Try escaping it like: REGEXP_REPLACE (name, '\*', '') May 2, 2020 at 9:46
  • I tried, but that also doesn't work @Lennart
    – Freedo
    May 2, 2020 at 10:14
  • Try '[*]' ; that is, use a "character class".
    – Rick James
    May 7, 2020 at 22:11

1 Answer 1

2

Apparantly the quote should be \\:

UPDATE name SET name = REGEXP_REPLACE (name, '\\*', '');

Fiddle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.