Re: Emulating flexible regex replace - Mailing list pgsql-general

From blackbee045
Subject Re: Emulating flexible regex replace
Date
Msg-id 1414129500694-5824107.post@n5.nabble.com
Whole thread Raw
In response to Re: Emulating flexible regex replace  (David G Johnston <david.g.johnston@gmail.com>)
List 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.


pgsql-general by date:

Previous
From: Joe Van Dyk
Date:
Subject: Finding date intersections
Next
From: twoflower
Date:
Subject: Re: Emulating flexible regex replace