正则表达式 去除所有非ASCII字符

  需求: 去除字符串中包含的所有外国字符

只能使用正则如下,找到包含非ASCII的记录

db=# select * from test where info ~ '[^(x00-x7f)]';  
 id |     info       
----+--------------  
  1 |  digoal 德哥  
  1 | 德哥  
(2 rows)  

参考链接: 

https://github.com/digoal/blog/blob/master/201703/20170310_02.md

原文地址:https://www.cnblogs.com/ryanzheng/p/9317837.html