I tried the following but it doesn't work.
REGEXP_REPLACE('$25,000.00','$|,',"")
REGEXP_REPLACE('$25,000.00','$',"")
REGEXP_REPLACE('$25,000.00','[$,]',"")
SQLTeam.com is a Microsoft SQL Server site. We're not experts in MySQL/MariaDB.
Based on the documentation:
https://dev.mysql.com/doc/refman/8.0/en/regexp.html#function_regexp-replace
My assumption would be that since $ is a regex metacharacter, you probably need to precede it with \ to force it to recognize the literal $ character:
REGEXP_REPLACE('$25,000.00','\$|,',"")
REGEXP_REPLACE('$25,000.00','\$',"")
REGEXP_REPLACE('$25,000.00','[\$,]',"")
1 Like