正则表达式 去除所有非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

posted @ 2018-07-16 15:21  Ryan_zheng  阅读(2641)  评论(0编辑  收藏  举报