in reply to Re^4: Remove text between two Start and End Tags (Regex)
in thread Remove text between two Start and End Tags (Regex)

Lots of splits? Use just one:
my $s = 'vif The increase in sensitivity of HIV - infected cells to <G +ENE> vif Fas </GENE> killing mapped to <GENE> vpu </GENE> , while nef + , vif, <GENE> vif </GENE> , <GENE> vpr </GENE> , and second exon of +<GENE> tat</GENE> did not appear to contribute'; my @ar = split m%(</?GENE>)%, $s; for my $i (0 .. @ar/4) { $ar[4*$i]=~ s%vif%<PGENE>vif</PGENE>%; } $s = join q[],@ar; print "$s\n";