I have below table in Duck Db. I want to replace the special characters in the column state with space. I used regex to do it but doesn't replace the special characters. What is the best way to replace the special characters in the columns using Regex?
Table :-
SQL Query:-
UPDATE test
SET State = REGEXP_REPLACE(State,'[^a-zA-Z0-9\s]', ' ')
WHERE State is not Null;
Output is same as the input.

By default, the
regexp_replacefunction only replaces the first occurrence of the regular expression. Use the global replace flag,g, as the fourth argument ofregexp_replace: