Alan Campbell wrote:
> hello folks,
Hello,
> Thanks for all the advice. As several of you suggested, the winning ticket
> turned out to be flipping to line-by-line regex from an array-slurped
> input i.e.
>
> # look for potentially problematic dissassembly of the following form: -
> # 8004b980 003c34f4 STW.D2T1 A0,*B15--[1]
> my @dis_lines = <>;
> foreach my $ln (@dis_lines) {
> if ($ln =~ m/.*ST[A-Z].*B15--.*[13579]]/) {
> print $ln;
> }
> }
>
> I think I got carried away by last problem I had which *required* a multi-
> line match & scalar slurp without line-by-line was faster.
Because you now have one line in $ln you can remove '.*' at the beginning of
the pattern and you should probably use non-greedy quantifiers for the others:
if ( $ln =~ /ST[A-Z].*?B15--.*?[13579]]/ ) {
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>