Re: Using functions in regexp replace captures

2021-08-04 Thread David G. Johnston
On Wednesday, August 4, 2021, David G. Johnston 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 i

Re: Using functions in regexp replace captures

2021-08-04 Thread David G. Johnston
On Wednesday, August 4, 2021, Tim Uckun wrote: > I want to do something like this > > SELECT REGEXP_REPLACE('some_string','(.*) > (.*)',some_function_that_returns_string('\2',' \1')); > > Is this possible at all? > > Generally I’d say yes, it is possible to combine multiple subqueries together to

Using functions in regexp replace captures

2021-08-04 Thread Tim Uckun
I want to do something like this SELECT REGEXP_REPLACE('some_string','(.*) (.*)',some_function_that_returns_string('\2',' \1')); Is this possible at all?