Looking further at this patch, it requires to have the second parameter as a single variable to be considered with "pvar" support, because I see you search for / in the second parameter. It makes it support like:

$var(se) = "/abc/xyz/";
avp_subst("$avp(x)", "$var(se)");

Right now it support PV in the replacement part of the subst expression, not allowing the match/regexp part.

Maybe is better to just add a new function that will always evaluate the subst parameter with variables, allowing more flexible format for subst parameter. At the end, you just need to have your added code in a dedicated function that evaluates first the parameter and then compiles the subst expression.

So we can have:

avp_susbtx("$avp(x)", "/$fU/$rU/g");

Allowing also:

$var(se) = "/" + $fU + "/" + $rU + "/";
avp_substx("$avp(x)", "$var(se)");

The new function can have a different name than avp_substx(), I used to exemplify here.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.