-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


D.J. wrote:
> OK, I'm stumped.  I need to create a regex that will match if anything
> other than two terms I've specified exist.
> 
> So for example, I have two terms I like, say "cat" and "dog".  I want
> the rule to match if a string contains anything other than cat or dog.
> 
> I tried ...
> 
> $value !~ /cat|dog/
> 
> ...but this had the unintended consequence of still matching a string
> like "cat dog bird" or "cat bird" since the string does contain one of
> my two terms.  So what do I need to do?  Thanks in advance!
> 
> - D.J.


D.J.,

 you're probably best off using META rules for this.  So you could have
something like (completely untested and off the top of my head in the
middle of the night):

body __CAT      /cat/
body __DOG      /dog/

meta NOT_CAT_AND_DOG    (!__CAT && !__DOG)

you should definitely check the man pages and/or wiki about writing
rules to do this properly, but that should get you started.

Alan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE7dfoE2gsBSKjZHQRAozpAKC+edJGc52qWz1qguOQReCLUy3z9ACgzFpn
V20guvwnlLaKHy3Aiy8FLQs=
=eGwC
-----END PGP SIGNATURE-----

Reply via email to