How can I remove all occurrences of $ and , from a string using REGEXP_REPLACE in mysql-10.4.24-MariaDB?

I tried the following but it doesn’t work.
REGEXP_REPLACE(‘$25,000.00’,‘$|,’,“”)
REGEXP_REPLACE(‘$25,000.00’,‘$’,“”)
REGEXP_REPLACE(‘$25,000.00’,‘[$,]’,“”)

$ is a special char you need to escape

REGEXP_REPLACE(‘$25,000.00’,‘[\$,]’,“”)

Should do the trick

Tried and it doesn’t work.

Works absolutely fine

1 Like

that’s because you forgot to replace @Thallius’s microsoft curly quotes with good old fashioned normal quotes

1 Like

I guess that doesn’t matter as he will find an answer on one of the 8 other forums he has posted the same question the same time…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.