Unicode regexp_replace in PostgreSQL [duplicate]
开发者_JAVA百科Possible Duplicate:
regexp_replace Unicode in PostgreSQL
How to regexp_replace for Unicode in PostgreSQL
i read this http://www.regular-expressions.info/unicode.html
select regexp_replace('s4y8sds', '\\p{Number}', '')
or
select regexp_replace('s4y8sds', '\\p{N}', '')
but not work
Thanks
As far as I know Postgres does not understand \p{} (as in the article you have linked). See the docs here http://www.postgresql.org/docs/9.0/static/functions-matching.html
According to this answer, internationalized regular expression in postgresql Unicode is not supported by Postgres in this way.
In case you want to replace numbers with empty string, you can do it like this:
select regexp_replace('s١4y8sd½s', '[0-9١٢٣¼½¾]', '', 'g');
regexp_replace
----------------
sysds
精彩评论