Search Postgresql Archives

Re: regexp_replace: LF, CR, or tab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/2/27  <seiliki@xxxxxxxxxxxxx>:
> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux