use strict; my %pat = ( abc => 1, xyz => 1 ); while (<DATA>) { my $out = ''; for my $seg ( unpack( 'A3A3A3', $_ )) { $out .= "$seg " if ( $pat{$seg} ); } print "$.: $out\n" if ( $out ); } __DATA__ abcmmmnnn mmmxyznnn mabcmxyzm xyzabcmmm abcmxyznn
In reply to Re: cool regular expression needed for matching in columns
by graff
in thread cool regular expression needed for matching in columns
by Ben Win Lue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |