使用regexp_replace格式:

regexp_replace(address,"正则表达式","替代字符")


(1)匹配所有字符:

select regexp_replace(address, '.*', '***') from table;


(2)匹配指定字符:

select regexp_replace('2016-06-05', '-', '') from table;


(3)匹配特殊字符(换行符):

select regexp_replace(name,'\\\\n','') from table;

 

例子:

SELECT  concat(SUBSTR(user_log_acct, 1, 6), '*****') AS user_log_acct  -- 只保留前六位,后面脱敏

SELECT  regexp_replace(scene, '@@', '_') AS scene  -- 替换指定的字符串

  


原文链接:https://blog.csdn.net/lhxsir/article/details/90374941

相关文章:

  • 2021-10-11
  • 2021-07-24
  • 2022-01-26
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案