in reply to Perl Command Line Regex
#!/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;
|
|---|