procmail
[Top] [All Lists]

Re: Sanity check please

2005-04-24 22:14:50
Hossein Movahhedian:

the `procmailrc' says:{{{
  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.
}}}

Yes, 'normal egrep(1) extended regular expressions'. See man egrep:
"Traditional  egrep  did not support the { metacharacter".

Every starting procmail-user has to go through this disappointment. 

Expect to come across code such as:

    dot8   = '........'
    dot32  = "${dot8}${dot8}${dot8}${dot8}"
    dot128 = "${dot32}${dot32}${dot32}${dot32}"

    :0
    *$ ^Subject:$dot128
    { LOG = "Long Subject" }


As often there is a good alternative:

    :0
    * ^Subject:.\/.+
    *    1^1 MATCH ?? .
    * -127^0
    { LOG = "$$${TAB}Long Subject$NL" }

(untested)

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>