raja_infy has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have a question on flip-flop operator. I have a script something like this
while (<>) { if(/START/.../END TIME (.+)/) { next if(/START/ | /^\s*$/); print; } }
The flop string 'END TIME (.+)' has a variable time at the end which I would like to extract and print. I see that the script match the 'END TIME (.+)', returns false and returns to the while loop beginning, but the matched sub-pattern (.+) is not stored anywhere ($1, $&, $+ etc). How do I extract this ?
Thanks in advance
-Raja
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: saving matching pattern with flip-flop operator
by bart (Canon) on Jun 23, 2011 at 10:54 UTC | |
Re: saving matching pattern with flip-flop operator
by wfsp (Abbot) on Jun 23, 2011 at 10:35 UTC | |
Re: saving matching pattern with flip-flop operator
by planetscape (Chancellor) on Jun 23, 2011 at 12:26 UTC | |
Re: saving matching pattern with flip-flop operator
by Anonymous Monk on Jun 23, 2011 at 10:38 UTC | |
Re: saving matching pattern with flip-flop operator
by choroba (Cardinal) on Jun 23, 2011 at 10:39 UTC |
Back to
Seekers of Perl Wisdom