http://qs321.pair.com?node_id=637102


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