sashac88 has asked for the wisdom of the Perl Monks concerning the following question:
It prints all the lines (except what is in unless of course) between the first "Start context" and the last "* End context *". I tried to use non-greedy regular expression (.*?) ,but still didn't get the desired result. Can someone please help?open DATA,"c://xxx.txt"; while(<DATA>) { if (/START context/ .. /* End Context */ ) { print unless /(START context |* End context *)/; } }
Edit by castaway, added code tags
|
|---|