in reply to How to not match some words but match all the others

This snippet from perlre seems promising (though I tend to leave regexes alone).
/bar/ && $` !~ /foo/
just another cpan module author