Search Postgresql Archives

Re: Using functions in regexp replace captures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, August 4, 2021, David G. Johnston <david.g.johnston@xxxxxxxxx> wrote:

But no, you cannot directly write:  f(x, y, g(a)) where a is the replacement string because you don’t know what a is when the inner function g is evaluated first.  You need:  f(x, y, g(h(x, y))) where h is the matching function, g is the transform, f is the replacement of the third argument into the x source text, and y is the pattern.  I presume the y is going to be the same value here but that isn’t required.


“a” is actually probably going to be an array of text here, its evaluation producing the replacement string that f requires.  a is not the replacement string itself.

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux