输入字符串:'HI每一个。我想(2-21-2022(从字符串(123('中删除逗号和其他任何特殊字符。
OUTPUT STRING:"嗨,每一个我想2-21-2022从字符串123中删除@逗号点和其他任何特殊的#字符">
提前感谢。
如果你在标题中说了什么:
从字符串中删除任何特殊字符,即使使用句点、逗号和空格
意味着您只想保留数字和字母,那么这样的正则表达式可能会起作用:
SQL> with test (col) as
2 (select 'HI every one. I want to (2-21-2022) remove the comma-dot and other any special character from string(123)' from dual)
3 select regexp_replace(col, '[^[:alnum:]]') result
4 from test;
RESULT
---------------------------------------------------------------------------------
HIeveryoneIwantto2212022removethecommadotandotheranyspecialcharacterfromstring123
SQL>
另一方面,这不是你发布的例子所代表的(正如已经评论的那样(。