in reply to Perl Command Line Regex
$ perl -ne 'print unless /<!-- REMOVESTART -->/ .. /<!-- REMOVEEND --> +/;' somefile.html > newfile.html
You may need to do /\Q ... \E/ if your tags contain regular expression metacharacters that would need to be escaped. If your start and end tags are more difficult to identify then an HTML parser would be more appropriate.
Cheers,
JohnGG
|
|---|