Hi, Cédric.
Works! Thank you very much for the hint. Apparently, you are much more
experienced with Perl, than me.
Just for reference, my working function wrapper for Perl regexp replace
now looks like this:
----------
create or replace function perl_regexp_replace (text, text, text, text)
returns text as $funcbody$
$_=$_[0];
eval "s/$_[1]/$_[2]/$_[3]";
return $_;
$funcbody$ language plperl immutable strict;
----------
Regards, Roman.
####################################
On Thu, 30 Aug 2018 11:20:49 +0200, Cédric Godin <cedric.godin@skynet.be>
wrote:
> Not being a perl expert either I think the problem lies in the regex
> line. You should eval it to have the expected result (and you can use
> your 4th parameter again then).
>
> eval "s/$_[1]/$_[2]/$_[3]";
>
> Regards, Cédric