You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Kelly Jones <ke...@gmail.com> on 2007/01/17 02:23:48 UTC
Which is more efficient: two regexp's or one regexp with alternation?
If I want to block subjects matching "foo" or "bar", is it more
efficient to write two regexps or a single "foo|bar" regexp?
I'd think a single regexp is more efficient, but SpamAssassin ships w/
rule-sets that have multiple rules. Given how many spams people get,
even a small improvement in efficiency would help?
Or are there multiple rules because the scores are different and have
to be optimized differently?
--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.
Re: Which is more efficient: two regexp's or one regexp with alternation?
Posted by Theo Van Dinter <fe...@apache.org>.
On Tue, Jan 16, 2007 at 06:23:48PM -0700, Kelly Jones wrote:
> If I want to block subjects matching "foo" or "bar", is it more
> efficient to write two regexps or a single "foo|bar" regexp?
It'll be more efficient to do a single regexp.
> Or are there multiple rules because the scores are different and have
> to be optimized differently?
Yes. Rules have different hit rates, so they need to get different
scores because it's better for overall efficacy.
--
Randomly Selected Tagline:
Illiterate? Write to us for a free brochure.