in reply to Adding a blank line after last line of match

use strict; my $ex = 0; while (<DATA>) { if ( /^java/ && /Exception$/ ) { print "\n" if $ex; $ex++; } print; } __DATA__ java.io.IOException at com.mycompany.MyClass.myMethod(com.mycompany.MyClass.java:3 +2) at com.mycompany.MyClass.main(com.mycompany.MyClass.java:18) java.lang.IllegalStateException at com.mycompany.MyClass.myMethod(com.mycompany.MyClass.java:25 +) at com.mycompany.MyClass.main(com.mycompany.MyClass.java:18)

holli, regexed monk