I am attempting to match between the first match of "Services", and not after, but I am getting everything using the following code:I cannot reproduce that. I do not get the lines between 'Users' and the next 'Services' (as expected).
Once again, I just want what is in between first occurrence of "Services" and "Users".
Or:use 5.010; while(<>) { state $done; if ( /^Services$/ .. /^Users$/ ) { print "$_"; $done = 1; next; } last if $done; }
while(<>) { if (my $r = /^Services$/ .. /^Users$/ ) { print $_; last if $r =~ /E0$/; } }
In reply to Re: Matching ranges
by JavaFan
in thread Matching ranges
by ldbpm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |