[lug] Need Procmail Filter for a Word or its Plural

Bill Thoen bthoen at gisnet.com
Mon Jan 3 12:15:14 MST 2005


I'm trying to create a procmail filter to add one to the score every time
it sees a word or its plural.

Say the word was "dog" (it's not, but I don't want to trigger everyone's 
spam filter!) and I want to catch all messages with at least 4 occurrences 
of the word "dog" in them.

I try this:

:0:
* -3^0
* 1^1 HB ?? ()\<dog\>
CANINE-MAIL

And it traps messages like:

The dog chased the other dog out of his dog house into the dog kennel.

But I want it to pass message like:

It's a doggone world in which doggerel is preached to dogfaces, though 
Omidog.

(and BTW, why does "dog dog dog dog" pass through? It shouldn't)

But ultimately, I want it to be able to trap a message like this:

The dog chased the other dogs out of his dog house into the dog kennel.


Anyone know how to specify a full word or its plural without having to 
make two entries?

- Bill Thoen




More information about the LUG mailing list