Re: Emulating flexible regex replace

From: blackbee045 <blackbee045(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Emulating flexible regex replace
Date: 2014-10-24 05:45:00
Message-ID: 1414129500694-5824107.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This yields a successful match since $1 in the /target pattern/ is replaced
> by "123" from the first captured group in *source* and the resulting
> string,
> "123 target text", matches the /target pattern/.

> I would like to execute a query which for a given /source pattern/ and
> /target pattern/ returns all rows from the *SEGMENT* table where *source*
> matches the /source pattern/ and *target* matches the /target pattern/
> after
> it has its references replaced with the actual captured groups.

> I believe this is not possible since *regexp_replace* expects a string as
> its /replacement/ argument which is not enough in this case.

-----
GuL
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Emulating-flexible-regex-replace-tp5824034p5824107.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message twoflower 2014-10-24 06:24:50 Re: Emulating flexible regex replace
Previous Message Joe Van Dyk 2014-10-24 02:10:55 Finding date intersections