procmail
[Top] [All Lists]

Re: MATCH with OR

2001-10-25 11:45:01
On 25 Oct, Paul Chvostek wrote:
| 
| [...]
| 
| Is there a defined "order of operations" for procmail conditions?  It
| would seem to me that "()\/one|two|three" might save "one" to MATCH, but
| not "two" or "three", but "()\/(one|two|three)" would populate MATCH for
| all three.  Is the \/ parsed before the |?  Does it matter?
| 

Although your guess may be intuitively logical, a simple test proves
otherwise.

---(cut here: zrc)---
DEFAULT=/dev/null
VERBOSE=no
NL="
"
VAR=two

MATCH   # unnecessary except to prove point
:0
* VAR ?? ()\/one|two|three
{ LOG="$VAR matched ()\/one|two|three; MATCH=$MATCH$NL" }

MATCH   # unnecessary except to prove point
:0
* VAR ?? ()\/(one|two|three)
{ LOG="$VAR matched ()\/(one|two|three); MATCH=$MATCH$NL" }
---(cut here: zrc)---

And run it...

$ procmail ./zrc </dev/null 
two matched ()\/one|two|three; MATCH=two
two matched ()\/(one|two|three); MATCH=two


[email address no good. replace procmail w/ procmail6 if you must.]
-- 
                   /"\
Don Hammond        \ /     ASCII Ribbon Campaign
Raleigh, NC US      X        Against HTML Mail,
                   / \      and News Too

_______________________________________________
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>