Stuart Johnston wrote:
> Dan wrote:
>> I'm running into more comment counting problems:
>> 
>> 
>> This crashes SA:
>> full FloatingTags1 /(>\s?[\$%A-Z0-9]\s?<.*?){90,}/is
>> 
>> 
>> This does not:
>> full FloatingTags2 /(>\s?[\$%A-Z0-9]\s?<.*?){30,}/is
>> 
>> 
>> while this doesn't crash, but also doesn't function:
>> full FloatingTags3 /(?>>\s?[\$%A-Z0-9]\s?<.*?){90,}/is
>> 
>> 
>> Based on Matt's recent comments:
>> 
>>> Yes, but across the entire message body using .* in a rule is
>>> REALLY slow. 

All of the following are really slow:

.*
.+
.{1,}
.{n,}

You can help the situation somewhat by making them ungreedy instead of greedy:
.*?
.+?
.{1,}?
.{n,}?

But the real solution is to cap the number of repeats at a reasonable level.
.* # DON'T USE
.+ # DON'T USE
.{1,17} # for some value of 17
.{n,n+17} # for some values of n and 17

This really helps performance.

-- 
Matthew.van.Eerde (at) hbinc.com               805.964.4554 x902
Hispanic Business Inc./HireDiversity.com       Software Engineer

Reply via email to