dannyd has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks,
I have been trying to match the pattern below, but have been greatly unsuccessful. There are 5 lines in the Output
This is the code I have been trying,-------------------------------------------------------------- Perl Progress -------------------------------------------------------------- dannyd@cli>
#!/usr/bin/perl open (FH, "test.txt"); while (<FH>) { print "Match!!\n" if ($_ =~ /^-+\nBG/ms); } close (FH);
I am able to match any one of the lines, but when I try to match the next one using the same regular expression, It fails, please help me figure out why this is happening
And any good material to read on multi line matching would also be highly appreciated
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: The simplest perl Multi Line matching.
by Anonymous Monk on Feb 08, 2011 at 08:03 UTC | |
by dannyd (Sexton) on Feb 08, 2011 at 08:54 UTC | |
by CountZero (Bishop) on Feb 08, 2011 at 22:06 UTC | |
Re: The simplest perl Multi Line matching.
by elwarren (Priest) on Feb 08, 2011 at 15:45 UTC |
Back to
Seekers of Perl Wisdom