in reply to Match all emails from all subdomains for a domain except one..
Something like this?
though that rejects "...@bar.foo.example.com" as well. This might be a good thing or a bad thing or a don't-care thing, you didn't specify./@(?!bar\.).*\.example\.com$/
So you could instead go for:
/@(?!bar\.example\.com$).*\.example\.com$/
If your teacher will let you declare a variable, then you could even use:
ormy $ex= ".example.com"; # ... if( /@(?!bar\Q$ex\E$)\Q$ex\E$/ ) {
But all of these don't reject "...@foo.bar.example.com" which you might want to do, so you could go for:my $ex= quotemeta(".example.com"); # ... if( /@(?!bar$ex$)$ex$/ ) {
/@(.*\.)?(?!bar\.)[^.]+\.example\.com$/
Updated based on shenme's reply. - tye/@((.*\.)?(?!bar\.)[^.]+\.)?example\.com$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Match all emails from all subdomains for a domain except one.. (tye)
by shenme (Priest) on Aug 09, 2003 at 07:36 UTC |