Re: regexp_replace: LF, CR, or tab

Поиск
Список
Период
Сортировка
От Osvaldo Kussama
Тема Re: regexp_replace: LF, CR, or tab
Дата
Msg-id 690707f61002270547q4fd789ev7f1b5d6617c4d120@mail.gmail.com
обсуждение исходный текст
Ответ на regexp_replace: LF, CR, or tab  (seiliki@so-net.net.tw)
Ответы Re: regexp_replace: LF, CR, or tab  (Bastiaan Wakkie <bwakkie@gmail.com>)
Список pgsql-general
2010/2/27  <seiliki@so-net.net.tw>:
> Hi!
>
> I am trying to replace characters '\r', '\n', or '\t' with space character ' '. As an example, I want string
"A\t\n\rB"becomes "AB".  The following statement seems to be not working. What mistake have I made? 
>
> TIA
>
> CN
> ========
>
> select regexp_replace(E'A\r\n\tB',E'[\r\n\t]',' ');
>  regexp_replace
> ----------------
>  A
>         B
> (1 row)
>


Try:
select regexp_replace(E'A\r\n\tB',E'[\r\n\t]',' ','g');

Osvaldo

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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: Can not match 0 on bytea
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can not match 0 on bytea