如何在PostgreSQL中使用regexp_replace for Unicode
我读了这个http://www.regular-expressions.info/unicode.html
select regexp_replace('s4y8sds', '\\p{Number}', '')
或
select regexp_replace('s4y8sds', '\\p{N}', '')
但没有工作
由于
答案 0 :(得分:0)
据我所知,Postgres不理解\ p {}(如你所链接的文章)。 请参阅此处的文档http://www.postgresql.org/docs/9.0/static/functions-matching.html
根据这个答案,Postgres不支持internationalized regular expression in postgresql Unicode。
如果您想用空字符串替换数字,可以这样做:
select regexp_replace('s١4y8sd½s', '[0-9١٢٣¼½¾]', '', 'g');
regexp_replace
----------------
sysds