while (<>) { $line=$_; chomp $line; $StartTag='<!--'; $EndTag='-->'; if (($line =~ m/\Q$StartTag\E/) .. ($line =~ m/\Q$EndTag\E/)){ $Flag=0; } elsif (($line =~/<!--/) || ($line =~/-->/)){ $Flag=0; } else { $Flag=1; } if($Flag){ print "$line\n"; } }
In reply to Re: Removing XML comments with regex
by gasho
in thread Removing XML comments with regex
by gasho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |