in reply to command line perl command to get between lines with non greedy match

Assuming from your example you are on a linux system, you should have a "tac", a filter program the reverses a file line-by-line. So:

tac somefilename | perl -ne 'print if /PATTERN3/../PATTERN1/' | tac

works on my ArchLinux system, and all you then need to do is fix up the extra TEST on the PATTERN3 line.

  • Comment on Re: command line perl command to get between lines with non greedy match
  • Download Code