[MlMt] exclude emails in address pattern ?

Benny Kjær Nielsen mailinglist at freron.com
Wed Oct 24 07:54:39 EDT 2018


On 16 Oct 2018, at 13:10, David Shepherdson wrote:

> On 16 Oct 2018, at 21.07, Max Rydahl Andersen wrote:
>
>> Is there a way via the address pattern to state .*@example\.com is 
>> good, except dad at example.com and wife at example.com ?
>
> If you can describe it with a regular expression, then you can put it 
> in. For example, you might be able to do something along the lines of:
>
>     .*(?<!dad|wife)@example\.com

For people not used to regular expressions, this uses so-called negative 
lookbehind (if you want to google it). It is also possible to use 
negative lookahead:

	(?!(dad|wife)@).*@example\.com

That is (perhaps) a bit easier to read in this case. (I have not tested 
it.)

-- 
Benny
https://freron.com/become_a_mailmate_patron/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20181024/721a32d1/attachment.html>


More information about the mailmate mailing list