Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    $string =~ s/<tr.+?NOTWANTED.+?<\/tr>//gsm;
    
    print $string;
    
  2. or download this
    my @tr = split(/(?=<tr)/, $string); # split at <tr, but do not remove 
    +<tr
    @tr = grep { ! /NOTWANTED/ } @tr;   # remove the elements with NOTWANT
    +ED
    print join('', @tr);