opolat has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I am trying to match the file path. The path between Originated From: and Last Modified. Can you help me. Thanks.
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
  • Comment on How can I match the expression between two key regular expressions
  • Download Code

Replies are listed 'Best First'.
Re: How can I match the expression between two key regular expressions
by Zaxo (Archbishop) on Nov 14, 2002 at 02:11 UTC
    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