Just for clarity: In the documentation
is mentioned "Flag g causes the function to find each match in the
string, not only the first one, and return a row for each such match. "
So in your example it was only matching \r so A\n\tB was returned
Osvaldo Kussama wrote:
> 2010/2/27 <seiliki(at)so-net(dot)net(dot)tw>:
>> 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?
>> select regexp_replace(E'A\r\n\tB',E'[\r\n\t]',' ');
>> (1 row)
> select regexp_replace(E'A\r\n\tB',E'[\r\n\t]',' ','g');
In response to
pgsql-general by date
|Next:||From: Bruce Momjian||Date: 2010-02-28 15:13:56|
|Subject: Re: [GENERAL] trouble with to_char('L')|
|Previous:||From: Martijn van Oosterhout||Date: 2010-02-28 11:36:11|
|Subject: Re: Putting index entries to XLog|