in reply to How can I match the expression between two key regular expressions

while (<DATA>) { m/Originated From:\s+(.+?)\s+Last Modified/ and print $1, $/; } __END__ Originated From: C:/My Documents/e3001cert_i_2000_707_11a_aft.f06 L +ast Modified / Created: 08/03/2002 Originated From: D:/My Documents/e3001cert_i_2000_707_11a_aft.f06 L +ast Modified / Created: 08/03/2002 Originated From: F:/My Documents/e3001cert_i_2000_707_11a_aft.f06 L +ast Modified / Created: 08/03/2002

The short-circuited and is to prevent printing holdovers from previous matches. Replace with push or whatever in real code.

After Compline,
Zaxo

  • Comment on Re: How can I match the expression between two key regular expressions
  • Download Code