procmail
[Top] [All Lists]

Re: body search (B ?? ...) & regex/scoring question

2002-03-05 20:04:49
in message <005201c1c4a5$8a6c8420$fb080142(_at_)ord351473>, 
wrote David W. Tamkin thusly...

parv_(_at_)yahoo(_dot_)com asked,

| can anybody tell me why would this not match ...
|
|   *  1^0 B ?? \<((minolta|maxxum|the).*[579]|(xt|50[05])si)\>
|
| ...this body (wrapped for email)...

|   I want to know the difference between the MINOLTA Dynax 7 and the \
|   MINOLTA Dynax 7 Limited edition.

It's in the regexp.  You didn't protect the leading slash, so procmail
interprets \< as

 \   end of whitespace
 <   literal left-side angle bracket
...
Solution: protect the leading slash ...

*  1^0 B ?? \\<((minolta|maxxum|the).*[579]|(xt|50[05])si)\>

or with an empty pair of parentheses (as most of us do it):

*  1^0 B ?? ()\<((minolta|maxxum|the).*[579]|(xt|50[05])si)\>

thank you david.  now i remember that something on the same lines
was mentioned in past in a thread about "MATCH and \/".

it would be swell if the point about protecting the backslash -- as
noted above -- makes into the procmailrc(5).  as procmailrc(5)
suggests that...

       Conditions start with a leading `*', everything after that
       character  is  passed  on to the internal egrep literally,
       except for leading and trailing whitespace.  These regular
       expressions   are  completely  compatible  to  the  normal
       egrep(1) extended regular expressions.  See also  Extended
       regular expressions.

...and  the regex otherwise works perfectly w/ regular/external
egrep (on freebsd).


On a separate note it's much better to use 2147483647^0 than 1^0
as the weight when all you're doing is trying to coax procmail
into ORing instead of ANDing, but that's not what you asked about.

i separated the regular expressions for testing.  i was initially
planning to create just one body match condition, but some of the
regexps are too cumbersome as it is, i will leave them separated.

and, yes i do use 2147483647^0 in other recipes which are pure, or
almost pure,  OR's.  thanks for the reminder though.


 - parv

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