Re: Replacing characters in a string

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
Cc: Luís de Sousa <luis(dot)a(dot)de(dot)sousa(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Replacing characters in a string
Date: 2010-09-15 14:46:03
Message-ID: 5360.1284561963@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> writes:
> Just specify 'g' as the flags parameter (the 4th one). It means 'globally'.

> SELECT regexp_replace('xaxx', 'x', 'e', 'g');

> There are more of this flags described here:
> http://www.postgresql.org/docs/8.4/interactive/functions-matching.html#POSIX-EMBEDDED-OPTIONS-TABLE

> p.s. The question is for hackers - BTW I did not find 'g' in this
> table, is it a docs bug?

No. That table is referenced for numerous cases where 'g' is not an
allowed flag. Instead, 'g' is documented in-line in the description
of regexp_replace.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-09-15 14:52:56 Re: Getting FATAL: terminating connection due to administrator command
Previous Message Mike Broers 2010-09-15 14:34:46 8.3.8 question about backup/recovery behavior