Re: Passing function parameters to regexp_replace

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Passing function parameters to regexp_replace
Date: 2011-09-17 11:31:58
Message-ID: 201109171331.58663.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Saturday 17. September 2011 13.21.43 Leif Biberg Kristensen wrote:

> UPDATE sources SET source_text = regexp_replace(source_text,
> E'n="(.*?)$1(.*?)"', E'n="\\1$2\\2"', 'g') where source_text like
> '%n="%$2%">%';

Sorry, I pasted a literal replacement, and substituted the parameters by hand.
The expression should of course be

UPDATE sources SET source_text = regexp_replace(source_text,
E'n="(.*?)$1(.*?)"', E'n="\\1$2\\2"', 'g') where source_text like
'%n="%$1%">%'

regards, Leif

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message R. Smith 2011-09-17 13:32:28 Sorting of data from two tables
Previous Message Leif Biberg Kristensen 2011-09-17 11:21:43 Passing function parameters to regexp_replace