Is there a way to have a greedy flip flop operator?
Not that I am aware of. However there are lots of ways to achieve the same effect. Here's one:
use strict; use warnings; use Test::More tests => 1; my $want = <<EOT; start text + 123 + 456 + 789 EOT my $out; while (<DATA>) { last unless (/^(start|\+)/); $out .= $_ } is ($out, $want); __DATA__ start text + 123 + 456 + 789 some other text not starting with +
If your actual data is different then you might have to try another approach but I think this should be fairly efficient.
In reply to Re: Greedy flip flop operator?
by hippo
in thread Greedy flip flop operator?
by chengchl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |