in reply to regexp look behind?
keep track of your last line's match. If you'll wrap your regex in parenthesis like so if (/(cache|disk-)/i), you can assign the match to a variable, like so $lastmatch = $1;, then each pass through your loop, you then can print "\n" if ($lastmatch ne $1 and "disk-" eq lc $1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regexp look behind?
by dbs (Sexton) on Nov 30, 2010 at 19:24 UTC | |
by AnomalousMonk (Archbishop) on Dec 01, 2010 at 01:25 UTC | |
by raybies (Chaplain) on Dec 01, 2010 at 13:21 UTC |