procmail
[Top] [All Lists]

Re: procmail 101

2007-04-13 01:29:07
David W. Tamkin schreef:
Ruud:

It contains:
* MATCH ?? ^^\/([^-]|-[^-])+
which I think does the same as
* MATCH ?? ^^\/.*[^-]

Is there a special reason for your (or Bart's) approach?

There is a difference, Ruud; your simplification can match a string
with two or more successive hyphens, as long as there is at least one
non-hyphen at the end.  Sean's (or Bart's) cannot match a string with
two adjacent hyphens.

Ah, hadn't seen that. Variant:

  * MATCH ?? ^^\/.*[^-]-
  * MATCH ?? ^^\/([^-]|-[^-])+


I think ^^\/(-?[^-])+ is equivalent to it, but
there are always those considerations of the form that's most
efficient for procmail to parse, and I never know how to determine
that.

Yes, I had thought of that variant too. Well, let's just benchmark it, 
by timing it against a header of a 1000 long lines that only has a 
match at the last line, and several almost-matches earlier on. And 
also with 1000 matching lines (scoring).

  $ time procmail ...

-- 
Groet, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>