in reply to Previous Line Matching Issues

Re^2: Grab 3 lines before and 2 after each regex hit (sliding window) shows a generic solution for the whole problem class of looking around n lines.

Especially the updated version should also solve special needs like non-overlapping matches.

Your "previous line" is just an edge case.

Cheers Rolf

( addicted to the Perl Programming Language)