procmail
[Top] [All Lists]

Re: Regex trouble:

1998-02-09 21:40:32
Sherwood Botsford <sherwood(_at_)math(_dot_)ualberta(_dot_)ca> writes:
The manual for 3.10 says that procmail supports sthe same set
of regex's as egrep.
...
(Looking for lines that have mroe than 10 characters without
any lowercase)  Does procmail not implement the {n,m} construct?
(My egrep does.)

You are correct: procmail does not support the {m,n} construct.  Newer
versions of the manual have sorta clarified this; the procmailrc(5)
manpage in 3.11pre7 says:

  Extended regular expressions
     The following tokens are known to both the procmail internal
     egrep  and  the  standard  egrep(1)  (beware that some egrep
     implementations include other non-standard extensions):
...


Lacking the {m,n} notation, you can just expand it yourself.  Note that
procmail does support negated character classes, so it may be easier to
use that:

        :0 B:
        * -500^0
        * +200^1 \!\!\!\!
        * +200^1 ^[^a-z][^a-z][^a-z][^a-z][^a-z][^a-z][^a-z][^a-z][^a-z][^a-z]+$
        * +200^1 \$\$\$
        /var/spool/spam/sales

You should consider upgrading from 3.10 to 3.11pre7, as 3.10 has several
serious bugs in it that were fixed in 3.11pre*.

Philip Guenther

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