http://www.perlmonks.org?node_id=672352


in reply to regex help humbly sought

Hi charlie_pi

you can try like this,

use strict; local $/;#####To read the whole content of a file while(<DATA>){ while($_=~/\(\!-- #BeginEditable \"([^"]*)" --\)(.*?)\(\!-- #EndEd +itable --\)/sgi){ print "IN:$1:$2\n"; ##do your stuffs here } }

Punitha

Replies are listed 'Best First'.
Re^2: regex help humbly sought
by Anonymous Monk on Mar 06, 2008 at 05:26 UTC
    Punitha, you are a magician. I have made a donation to Perl Monks Foundation in your name, and I pledge also to study the regex you've written so that I can pass it on. Thank you for your timely help! Charlie Pi