procmail
[Top] [All Lists]

Re: whole word recipe

2002-05-27 11:36:38
I have the following recipe where one line doesnt
seem to work.
...
        :0
        * ^Subject:.*WEIGHT
              {
              :0 B:
->prolem line?        * .*\<HUNZA\>.*\<BREAD\>
              IN-Bread
              }

This catches a lot of people.  If you check closely through the
procmailrc man page you'll see that \< and \> *don't* match a word
boundary but *do* match non-word characters.  So \>.*\< will need to
match at least 2 characters!.  You can replace that condition line with
something like:

   * ()\<HUNZA\>(.*\<)?BREAD\>

As is hopefully clear, the regular expression \>(.*\<)? will match
against one non-word character followed, optionally, by (any number of
characters which ends with a non-word character).

Hope that helps,
Martin
-- 
Martin McCarthy                 /</    http://procmail.non-prophet.org
    `Procmail Companion'        \>\
     Addison Wesley             /</                  PGP key available
_______________________________________________
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>