Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

regexp_replace: LF, CR, or tab



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)



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group