Re: Simple method to format a string?

Поиск
Список
Период
Сортировка
От Emi Lu
Тема Re: Simple method to format a string?
Дата
Msg-id 4FE22FA3.2030502@encs.concordia.ca
обсуждение исходный текст
Ответ на Re: Simple method to format a string?  (Bosco Rama <postgres@boscorama.com>)
Список pgsql-general
>     select trim(regexp_replace('123456', '...', '\& ', 'g'));
>
> If you don't care about trailing space remove the 'trim()'.
>
> The replacement string may need to be escaped differently depending
> on your PG version and setting for standard_conforming_strings.  For
> example:  E'\\& '

After combined with several more replace(s), regexp_replace will provide
me the expecting result.

Thanks!
Emi

--
select
regexp_replace(
    replace(
        replace(col-val, ' ', ''), '-', ''),
         .... replace...
     '(...)', E'\\1 ', 'g')
from tn;

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: RETURNING MORE THAN ONE CUSTOM TYPE FROM FUNCTION
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: 32-bit libpq with 64-bit server