procmail
[Top] [All Lists]

Re: capturing the OR that succeeds ???

2004-05-14 04:14:59
On Thu, May 13, 2004 at 09:42:11PM -0500, David W. Tamkin wrote:

Dallman Ross suggested to Michael Schleif,

 MATCH  # unset this first to avoid contamination from earlier recipes
:0 BD

Presumably that should be  :0 BD fw  like the next.

Yes.  Thanks, David.  I hadn't thought that far yet when I was writing
the top of my response.

    * 9876543210^0 ()\/aaa
    * 9876543210^0 ()\/bbb
    * 9876543210^0 ()\/ccc
    * 9876543210^0 ()\/ddd
    * 9876543210^0 ()\/eee

Likewise, I'm assuming that

       | formail -I "X-Procmail: alphabet soup: $MATCH"

would appear here.

Ditto.


However, you're still running body greps up to five times on "hit" messages
and all of five times on non-triggering messages.  You can have the same
effect with one pass like so:

 MATCH
 :0 D fw
 * B ?? ()\/(aaa|bbb|ccc|ddd|eee)
 | formail -I "X-Procmail: alphabet soup: $MATCH"

No, the effect is not the same.

The first will match on the first string that it tests for and finds. 
The second will match on the earliest of the five strings to appear in 
the text.

Yes, good thought.  I had made an assumption, which I should not have
without at least pointing it out, that the OP didn't care which match
came first.  He has since said that in this case it's not so important
to him, but his preference would be the order shown.  So now he has
to ask himself which is more important to his implementation of his
recipe -- fewer passes at the body, or strict adherence to a preferred
order.  Thanks again, David.

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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