Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: saving matching pattern with flip-flop operator

by wfsp (Abbot)
on Jun 23, 2011 at 10:35 UTC ( #911045=note: print w/replies, xml ) Need Help??

in reply to saving matching pattern with flip-flop operator

The second regex clears the capture from the first.
while (<DATA>) { if(/START/.../END TIME (.+)/) { my $time = $1; next if(/START/ | /^\s*$/); print $time, qq{\n}; } } __DATA__ START END TIME 123 START END TIME 456
123 456

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://911045]
[LanX]: strangely you can't disable the XP nodelet
[LanX]: But you can use CSS to hide it
[LanX]: and disoplay the data permanently in your peronal nodelet
[marinersk]: I saw that you could post it on the Personal Nodelet, but you have to provide the content also. No way to auto-populate it. Not that this would solve my distraction problem...
[LanX]: there are template variables to "Auto-populate" it
[marinersk]: Yeah, someday I might become interested enough to poke around PerlMonks more internally. Most of the fancy stuff is way down on my to do list.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2017-05-29 14:23 GMT
Find Nodes?
    Voting Booth?