in reply to Perl Command Line Regex

Hi,
Fletch is right, that it's usually not a good idea to do SGML/HTML/XML parsing using perl regex. But in case you really want to do it, the following snippet will remove the two tags, and the text in between.
#!/usr/bin/perl use strict; use warnings; my $string = <<EOFDATA; whatever <!-- REMOVESTART --> test test test <!-- REMOVEEND --> you are trying to do EOFDATA my $start_tag = quotemeta('<!-- REMOVESTART -->'); my $end_tag = quotemeta('<!-- REMOVEEND -->'); $string =~ s{$start_tag.*?$end_tag\n*}{}gms; print $string;