> -----Original Message-----
> From: Dave W [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 11:09 AM
> To: debian users list
> Subject: regexp help
>
>
> I'm using animail and spamassassin on my mail now, with -some- success
> on spam, but need help with animail's ~/.animail/filter file.  It can be
> filled with regexps for mail blocking, but I'm a regexp newbie and can't
> find how the heck to do an "and" in a regexp.  "or" is easy, but _is_
> there an "and" function for regexps?
>
> Right now my filter file is simple, like this:
>
> ^Subject:.*custom.*website
> ^Subject:.*celeb*
> ^From:.*discount
> ^Subject:.*discount
> ^From:.*[EMAIL PROTECTED]
> ^Subject:.*laudable.*project
> /viagra/
> /penis/
>
> ...but I'd like to be able to block subject lines or bodies that have,
> say, 'celeb' and 'sex' in any order.

I'm not familiar with animail's regex engine but most modern regex systems
can do something like:

Subject:.*(celeb.*sex|sex.*celeb)

Or maybe

Subject:.*((celeb|sex|string|marching bands).*)+

Or even

Subject:.*((celeb|sex|fuzzy little|rabbits).*){2,}


The | operator typically has very low precedence for just this reason. What
you can do is largely a function of what that specific regex engine is
capable of doing.





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to