[ale] NewbieQ Perl filtering question

A LeDonne aledonne.listmail at gmail.com
Thu Jun 29 18:54:36 EDT 2006


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



More information about the Ale mailing list