No such thing as a small change | |
PerlMonks |
Greedy flip flop operator?by chengchl (Acolyte) |
on Apr 26, 2018 at 06:46 UTC ( [id://1213573]=perlquestion: print w/replies, xml ) | Need Help?? |
chengchl has asked for the wisdom of the Perl Monks concerning the following question: Hi Perl Monks, I have a question about flip flop operator ( /pattern/ .. /pattern/ ) and hope for your instructions/thoughts. Suppose I have a text file like this : start text + 123 + 456 + 789 some other text not starting with + I would like to extract from "start text" to the one line before "some other text not starting with +". That is to say, in this example, to extract the first four lines. I wrote a script like this - === but it only generates the first two lines. Is there a way to have a greedy flip flop operator? thanks in advance.
Back to
Seekers of Perl Wisdom
|
|