开发者

Change case, or use callback function, in regexp_replace in PostgreSQL?

开发者 https://www.devze.com 2023-02-25 00:50 出处:网络
Is it possible to change the case of what you matched in REGEXP_REPLACE to upper or lower case, in Postgres 8+? In Perl you can use \'\\u\', \'\\U\', \'\\l\', and \'\\L\', but there doesn\'t seem to b

Is it possible to change the case of what you matched in REGEXP_REPLACE to upper or lower case, in Postgres 8+? In Perl you can use '\u', '\U', '\l', and '\L', but there doesn't seem to be anything similar in Postgres.

I'm trying to do something that is functionally much like initcap, but not quite the same.

Alternatively I think I could use a function callback, with the m开发者_如何转开发atches as parameters, but it doesn't look like that is possible either.

0

精彩评论

暂无评论...
验证码 换一张
取 消