in reply to Perl regex question
perl -MRegexp::Assemble -e ' $ra=Regexp::Assemble->new; $ra->add($_) for qw(list of words); local $/=undef; # slurp mode on $re=$ra->re; # create a regex from your list of words while(<>){ print "$1 in $ARGV\n" if $_ =~ m{($re)} }' list of files
print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl regex question
by ikegami (Patriarch) on Mar 08, 2009 at 16:04 UTC |