use Regexp::Trie; my $rt = Regexp::Trie->new; open(IN, "phrases.txt"); @list = <IN>; for (@list){ chomp; $rt->add($_); } my $regexp = $rt->regexp; print "$regexp\n"; if ($incoming{text} =~ qr(\b$regexp\b)){ print "Matched: $& \n"; }
In reply to Re: Matching a long list of phrases
by artist
in thread Matching a long list of phrases
by Hagbone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |