輸入字串:'大家好。我想(2-21-2022)從字串(123)'中洗掉逗號和其他任何特殊字符。
輸出字串:'嗨,我想在 2022 年 2 月 21 日從字串 123 中洗掉@逗號點和其他任何特殊的#字符'
提前致謝。
uj5u.com熱心網友回復:
如果你在標題中說:
即使使用點、逗號和空格,也可以從字串中洗掉任何特殊字符
意味著您只想保留數字和字母,那么這樣的正則運算式可能會:
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>
另一方面,這不是您發布的示例所代表的(正如已經評論過的)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/432946.html
下一篇:如何使用觸發器復制記錄?
