regexp_replace: LF, CR, or tab

From: seiliki(at)so-net(dot)net(dot)tw
To: pgsql-general(at)postgresql(dot)org
Subject: regexp_replace: LF, CR, or tab
Date: 2010-02-27 09:17:38
Message-ID: 20100227091744.8EE8EF48085@m5.so-net.net.tw
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anton Maksimenkov 2010-02-27 09:30:10 Re: ERROR: value out of range: underflow
Previous Message seiliki 2010-02-27 09:05:42 Can not match 0 on bytea