Alexei Batyr' wrote:
Gordon Messmer wrote on Wednesday, June 04, 2003 10:03 PM [GMT+4=MSD]:


You should understand that the time it takes to match a pattern with
'.*' will have something like an exponential growth rate relative to
the number of '.*' in your pattern.

If you're searching the body of a message, the impact will obviously
be much greater.


I've looked more closely and found out that insane man crammed into his
.mailfilter 70 (!) rules with body searching (some of them with ".*"). No
wonder that filtering takes more than 5 minutes!

Yeah... I'd talk to him. ;)


'.*' is not usually advisable. It's overused by people too lazy to express what they mean. Be specific:
- If you want any number a coherent set of characters, use a pattern which only matches those characters. Use '[:space:]*' when you need any amount of whitespace, or one of the other character classes which apply.
- If you know what character will end the sequence, use a pattern which matches characters other than that. For instance: '[^,]*' if you know that the pattern matches up to the next comma.


Those two considerations will greatly speed up regular expression (and maildrop pattern) matching. Spread the word ;)



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to