Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: pattern matching (greedy, non-greedy,...)

by ikegami (Patriarch)
on Dec 17, 2009 at 02:22 UTC ( [id://813120]=note: print w/replies, xml ) Need Help??


in reply to Re: pattern matching (greedy, non-greedy,...)
in thread pattern matching (greedy, non-greedy,...)

I was gonna suggest using the range op, but it doesn't really help
my @lines; while (<DATA>) { my $is_key = /KEY/; @lines = () if $is_key; if (my $in_range = $is_key .. /PATTERN/) { push @lines, $_; print @lines if $in_range =~ /E0\z/; } }

If one continues to simplify the above, one gets the parent's code.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://813120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found