procmail
[Top] [All Lists]

Re: capturing the OR that succeeds ???

2004-05-15 04:01:02
On Sat, May 15, 2004 at 02:58:51AM +0200, Ruud H.G. van Tol wrote:
If match is still unset after the ccc-line, it must be ddd.
But if it's set (=eee), the scan for ddd should still happen:

     MATCH # unset

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

Yes!  *That's* what I was on the verge of grasping, but had failed to
realize, ultimately, when we wrote. :-)  Good work.  (Kicks self for
trying only "MATCH ?? ." in a similar test instead.)

Note that I'm not at all awake yet, so proceed with caution;
but I think we can improve the efficiency further by moving
the MATCH reparse up high:

       MATCH # unset

       :0 B D fw h
       * eee|bbb|ccc|ddd|\/aaa
       * 9876543210^0 MATCH ?? .
       * 9876543210^0 ()\/aaa
       * 9876543210^0 ()\/bbb
       * 9876543210^0 ()\/ccc
       * 9876543210^0 ()\/ddd
       *          1^0
       | formail -I "X-Procmail: alphabet soup: ${MATCH-eee}"


Yes, that seems to work.  Okay, that's what I was close to
last night, but couldn't see that the re-test was needed if
the first match was not there.

-- 
dman

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