procmail
[Top] [All Lists]

Re: Regex trouble:

1998-02-10 00:55:19
Mon 98-02-09 Sherwood Botsford <sherwood(_at_)math(_dot_)ualberta(_dot_)ca> 
list.procmail
| 
| 
| :0 B:
| * -500^0
| * +200^1 \!\!\!\!
| * +200^1 ^[A-Z0-9'!:;>-<. #$]{10,}$ 
| * +200^1 \$\$\$
| 
| The manual for 3.10 says that procmail supports sthe same set
| of regex's as egrep.

Bad news: no, it's only a historical statement. Egreps differ greatly.
Take a look at pm-tips.txt (X-info header, or .html at ftp dir)

        8.0 Matching and regexps
        ...
        8.13 Procmail and egrep differences

| * +200^1 ^[A-Z0-9'!:;>-<. #$]{10,}$ 
                               ^^^^^
Forget this, procmail won't undertand repetition.

| Ok so why isn't my second regex matching.

I would change that to read

    *   50^1 [!]

And it would fing 6 exclamation marks ( 50 x 6 = score 300 )
   
    THIS IS A ONE TIME MAILING!!!!!
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    YOU WILL NOT RECEIVE THIS MESSAGE AGAIN!
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    "EARN WHILE YOU LEARN-------FREE SOFTWARE"

In fact you can detect this and many similar messages simply by matching

    :0
    * B ?? one time mailing
    { sink_it }

jari

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