I
ivo welch
I have tried for a while to figure out how to use the experimental
perl regex balanced paren feature (perlfaq6), but failed. if this is
possible, could someone please give me an example of the magic
invokation?
$text= "this is \macro{a { irrelevant } b} and this is \macro{c
{e{}}{} d}"
$text=~ s/\macro{ [matching .* to closing] }/\macro{***}/g; # help
here
and I would get
$text eq "this is \macro{***} and this is \macro{***}"
Is this even possible with regex? If not, could someone please point
me to the recommended method for global balanced substitutions (not
just matching)?
help appreciated. /iaw
perl regex balanced paren feature (perlfaq6), but failed. if this is
possible, could someone please give me an example of the magic
invokation?
$text= "this is \macro{a { irrelevant } b} and this is \macro{c
{e{}}{} d}"
$text=~ s/\macro{ [matching .* to closing] }/\macro{***}/g; # help
here
and I would get
$text eq "this is \macro{***} and this is \macro{***}"
Is this even possible with regex? If not, could someone please point
me to the recommended method for global balanced substitutions (not
just matching)?
help appreciated. /iaw