in reply to Re: Pattern Matching Problem
in thread Pattern Matching Problem

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.

Replies are listed 'Best First'.
RE: RE: Re: Pattern Matching Problem
by chromatic (Archbishop) on Jun 27, 2000 at 03:44 UTC
    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.