[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] NewbieQ Perl filtering question
- Subject: [ale] NewbieQ Perl filtering question
- From: aledonne.listmail at gmail.com (A LeDonne)
- Date: Thu, 29 Jun 2006 18:54:36 -0400
- In-reply-to: <[email protected]>
- References: <[email protected]>
On 6/29/06, Mills, John M. <Mills.J at ems-t.com> wrote:
> ALErs -
>
> I need to return only the part of a text line that falls between two
> expected character strings, as it:
>
> Input: blah..blah..string1<good content>string2..garbage..garbage
> Output: <good_content>
>
> TIA for a bit of guidance.
>
> - Mills
$Input =~ /string1(.*)string2/s
$Output = $1
This assumes that string2 is never a substring of <good content>. You
can drop the s modifier if <good content> is never multiple lines.
-A