Re: regexp_replace puzzle

Поиск
Список
Период
Сортировка
От David W Noon
Тема Re: regexp_replace puzzle
Дата
Msg-id 20100310165707.5ba9863c@dwnoon.ntlworld.com
обсуждение исходный текст
Ответ на regexp_replace puzzle  (Harald Fuchs <hari.fuchs@gmail.com>)
Список pgsql-general
On Wed, 10 Mar 2010 13:41:54 +0100, Harald Fuchs wrote about [GENERAL]
regexp_replace puzzle:

[snip]
>  SELECT val,
>         regexp_replace(val,
>          '^(.*\W)?(C\d{7}|[DI]\d{6}|S\d{10})(\W.*)?$',
>          '\1' || '»\2«='|| sha224enc('\2') || '\3', 'i')
[snip]
>i.e. the first '\2' gets properly expanded by the second paren match,
>but the second '\2' doesn't get expanded.

The second instance of '\2' is first passed to sha224enc(), then that
function's result is passed to regexp_replace.
--
Regards,

Dave  [RLU #314465]
=======================================================================
david.w.noon@ntlworld.com (David W Noon)
=======================================================================

В списке pgsql-general по дате отправления:

Предыдущее
От: Ben Chobot
Дата:
Сообщение: Re: log_statement and syslog severity
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: How to? Timestamp with timezone.