PostgreSQL中的Unicode regexp_replace

时间:2011-08-09 12:30:11

标签: regex postgresql

  

可能重复:
  regexp_replace Unicode in PostgreSQL

如何在PostgreSQL中使用regexp_replace for Unicode

我读了这个http://www.regular-expressions.info/unicode.html

select regexp_replace('s4y8sds', '\\p{Number}', '')

select regexp_replace('s4y8sds', '\\p{N}', '')

但没有工作

由于

1 个答案:

答案 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