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. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general