procmail
[Top] [All Lists]

filtering question

1996-05-18 17:59:38
I'm a beginner with Procmail, and am excited about it's ability to sort
mail into folders.  

However, here's a search problem that has me stumped: I'd like to search
the Subject: line of the headers and bodies of all mail for "test" (case
insensitive), and attach the found messages to the folder "Test".  Easy
enough so far.  However, I don't want to find messages that have "test
case" in the body but no other instance of "test" on another line.  I.e.,
I want to find these messages:

(1) All messages that have "test" (no quotes) in the subject line,
without regard to the body.  And,

(2) All messages that have "test" (no quotes) in the body, where "test"
is not immediately followed by a space and "case" (no quotes).  ("test",
and also "test case" are not found on the same line in the mail I'm
looking for.)

Examples for (2):

I want this body:
 
  Rubber baby buggy bumpers test completed.

And this one:

  Rubber baby buggy bumpers test completed.
  Friday's test case failed.
 
I don't want this one:

  Rubber baby buggy bumpers test case completed.
  

My guess is that I should be able to do (2) with the right regular
expression, but nothing I've tried works.

Help, please?

Dick Moores  rdm(_at_)netcom(_dot_)com

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