procmail
[Top] [All Lists]

Re: Extracting in an Alternation (Was Scoring Function Question)

1999-04-15 11:16:52
David wrote:
                        The limitation is that you can't extract inside an
alternation (though you can alternate on either side of an extractor)  I've
occasionally wished it were possible, but changing it probably would break
something else (besides bloating the code).

I just tried the following, and it worked as I hoped it would. Messages
without either pattern reported "--none found--" and messages with one or both
strings reported the last one matched. Did you mnean something else?

 MATCH="--none found--" NL="
"
 :0
 * 1^1 ^(Subject:[      ]*\/test.*|\/X-test:.*)
 { LOG="Found one: " }
 LOG=$MATCH$NL

I also tried it with the condition line as follows, with the same result:

 * 1^1 ^(Subject:[      ]*\/test|\/X-test:).*

-- 
Rik Kabel          Old enough to be an adult              
rik(_at_)netcom(_dot_)com