Lets say, I have domain
@abc.com.
I need to match the pattern if there are 3 or more external recipients.
For example: To:
You need to match:
"@"
"abc."
"@"
This expression will match a subject with 3 external recipients:
(?:@(?!abc[.]).*?){3}
DEMO
It uses the negative lookahead (?!abc[.])
to check it's not followed by your domain. The .*?
is there to comsume the chars between different @
s.
You may as well change abc[.]
to abc[.]com(?:[; ]|$)
or your real domain.