in reply to Re^2: Delete all "records" which contain a regex match
in thread Delete all "records" which contain a regex match
Hi, ilovechristy, here is one way to do it. Also have a look at perlre.
use strict; use warnings; local $/; my $data = <DATA>; $data =~ s/COMMENT:(?:(?!-----).)*-----//gs; print $data; output: ------- AUTHOR: bobMonk TITLE: Monk Software Chart STATUS: Publish CATEGORY: Monks DATE: 05/21/2006 11:36:16 AM -----
Prasad
|
|---|