Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Regular expression question strikes again

by sgt (Deacon)
on Sep 05, 2007 at 09:47 UTC ( [id://637102]=note: print w/replies, xml ) Need Help??


in reply to Regular expression question strikes again

probably you just need Corion's solution, but be careful when you mix positive and negative logic. Imagine you have qr{^Remote.*$} and qr{^.*tmp$} You might want to process all Remote files that don't end in tmp.

Maybe it's better to have a two-pass (or n-pass) filter, with a first pass using positive logic and a second pass using negative logic, for instance. The point is that you use the same rules in any pass.

So you use positive logic labels, and your filter decides if it wants to grep or 'grep { not ...}'

cheers --stephan
  • Comment on Re: Regular expression question strikes again

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found