in reply to Pattern Matching Problem

perl -n -e 'print if /Twist 1/ .. /Twist 2/' testresults

The .. operator is cool!

--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000
<http://www.yapc.org/Europe/>

Replies are listed 'Best First'.
RE: Re: Pattern Matching Problem
by Adam (Vicar) on Jun 27, 2000 at 01:02 UTC
    This is why I frequent perlmonks... I always learn stuff.

    I had one issue with your method, it printed the Twist flags. So I tried it this way:

    perl -n -we "print if /Twist 1/ .. /Twist 2/ and not /Twist \d/" test. +txt
    Which stripped out the flags too. However, I would bet there is a better way to do it that I am not able to think of at the moment.
      Hmm, how about: perl -n -we "print if s/Twist 1// .. s/Twist 2// && ! /Twist \d/" text.txt Untested, as I'm still sure what your data set is.