/
.*@.*\.(?!(.*\.)?(com|net|org|int|edu|gov|biz|mil|coop|us))
/
g
.*
matches any character (except for line terminators)
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
@ matches the character @ literally (case sensitive)
.*
matches any character (except for line terminators)
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\. matches the character . literally (case sensitive)
Negative Lookahead (?!(.*\.)?(com|net|org|int|edu|gov|biz|mil|coop|us))
Assert that the Regex below does not match
1st Capturing Group (.*\.)?
? Quantifier — Matches between zero and one times, as many times as possible, giving back as needed (greedy)
.*
matches any character (except for line terminators)
\. matches the character . literally (case sensitive)
2nd Capturing Group (com|net|org|int|edu|gov|biz|mil|coop|us)
1st Alternative com
com matches the characters com literally (case sensitive)
2nd Alternative net
3rd Alternative org
4th Alternative int
5th Alternative edu
6th Alternative gov
7th Alternative biz
8th Alternative mil
9th Alternative coop
10th Alternative us
Global pattern flags
g modifier: global. All matches (don't return after first match)