just try this
$input=':<exp>2aF+-b&2z4676</exp><br>'; $input =~ s/(<exp>)(.*?)(<\/exp>)/$1.&exp($2).$3/egsi; print $input; sub exp { my ($a)=@_; $a =~ s/[a-z]+/<it>$&<\/it>/gsi; $a =~ s/(&)(.*?)(;)/$1.&($2).$3/egsi; sub amp { my ($m)=@_; $m =~ s/<\/?it>//gsi; return($m); } return($a); } output: :<exp>2<it>aF</it>+-<it>b</it>&2<it>z</it>4676</exp><br>
senthil kumar.k
In reply to Re: find and replace
by perlsen
in thread find and replace
by texuser74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |