[ale] NewbieQ Perl filtering question

Mills, John M. Mills.J at ems-t.com
Fri Jun 30 08:36:26 EDT 2006


A LeD -

Thanks. Actually both those conditions are both met in my case.

 - Mills 

-----Original Message-----
...
> 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>
...

$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