Re: regexp_replace

From: Perry Smith <pedz(at)easesoftware(dot)com>
To: polen(dot)t2006(at)freenet(dot)de
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: regexp_replace
Date: 2007-07-24 14:20:29
Message-ID: 8CB9C8F0-C3B6-4AD8-8044-1832101EDD49@easesoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jul 23, 2007, at 9:50 AM, polen(dot)t2006(at)freenet(dot)de wrote:
> fieldname=regexp_replace(fieldname,old_sub_string,new_sub_string)

Add a 'g' flag:

fieldname=regexp_replace(fieldname,old_sub_string,new_sub_string, 'g')

From the end of a paragraph in 9.7.3 just before 9.7.3.1:

> The flags parameter is an optional text string containing zero or
> more single-letter flags that change the
> function’s behavior. Flag i specifies case-insensitive matching,
> while flag g specifies replacement of each
> matching substring rather than only the first one.

Perry Smith ( pedz(at)easesoftware(dot)com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marco Colombo 2007-07-24 14:24:48 Re: Delete/update with limit
Previous Message Fst Procurement 2007-07-24 14:19:17 Re: Connection error