procmail
[Top] [All Lists]

Re: rule to catch a certain number of characters

2007-05-27 20:20:17
On 5/27/07, Dallman Ross <dman(_at_)nomotek(_dot_)com> wrote:
Bart Schaefer wrote Sunday, May 27, 2007 5:56 PM:

:0:
* B ?? <title>\/.*</title>
* 1^1 MATCH ?? > 1000
spampile

But isn't that use of MATCH going to require LINEBUF?

No.  LINEBUF is only used when there's a $VARIABLE that has to be
expanded before the expression can be "compiled' -- it's not used for
the stuff to the left of the "??" against which the condition is being
compared.

In my tests, though, it was significantly faster
not to capture such a long string and count it.
Maybe I'm not thinking about this correctly?

It may very well be faster since you're doing a match against a very
simple (if very long) expression and you're doing only the match and
not first a match and then a count.  The counting solution has the
advantage of being short and obvious (much easier to change the number
in the count expression than to reconstruct the pattern from its
component bits if the string to be matched changes length) and
independent of LINEBUF.

____________________________________________________________
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