[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] NewbieQ Perl filtering question



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