#!/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;
In reply to Re: Perl Command Line Regex
by rminner
in thread Perl Command Line Regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |