The stupid question is the question not asked | |
PerlMonks |
Re: Count multiple pattern matchesby kappa (Chaplain) |
on Dec 07, 2004 at 15:01 UTC ( [id://412915]=note: print w/replies, xml ) | Need Help?? |
Try Regexp::List. It converts qw/foobar fooxar foozap fooza/ to qr/foo(?:[bx]ar|zap?)/ using Trie structure so that the resulting regex is much more efficient than naive /foobar|fooxar|.../. And tillys approach to counting each word by capturing the match sounds great.
--kap
In Section
Seekers of Perl Wisdom
|
|