zzgulu has asked for the wisdom of the Perl Monks concerning the following question:
I have a text file that contains many sections. I want to extract certain sections with associated content. Why the code below when finds the first matched section (Findings) stops looking for the other section (Complications)? If I add more sections to the OR list, it only finds the first match and ignores the rest. Really apprecite your wisdom!
.... ..... while(<IN>) { undef ($/); $string=$_; $string =~m/(FINDINGS|COMPLICATIONS|(:)(.*?)(^[A-Z])/sgm; print "processing $file\n"; print OUT "$1$2\t$3"; }exit; .... ......
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: multiple OR match fails
by jwkrahn (Abbot) on Jan 31, 2012 at 03:33 UTC | |
by bimleshsharma (Beadle) on Jan 31, 2012 at 10:19 UTC | |
Re: multiple OR match fails
by JavaFan (Canon) on Jan 31, 2012 at 02:52 UTC | |
Re: multiple OR match fails
by InfiniteSilence (Curate) on Jan 31, 2012 at 03:16 UTC | |
by ikegami (Patriarch) on Jan 31, 2012 at 06:16 UTC | |
Re: multiple OR match fails
by lune (Pilgrim) on Jan 31, 2012 at 13:33 UTC | |
by zzgulu (Novice) on Jan 31, 2012 at 15:36 UTC | |
by Marshall (Canon) on Jan 31, 2012 at 22:41 UTC |
Back to
Seekers of Perl Wisdom