I am looking for a REGEX (JS) that I can use to match all subdomains for a domain as well as the TLD domain in email addresses.
Here is an example:
I would like to be able to match any the following:
- joe@canada.ca
- joe@it.canada.ca
- joe.smith@business.canada.ca
But not match
- joe@visitcanada.ca
By default we use something like:
/(.*)@(.*)canada\.ca/gm
But this matches all of the above. Would ideally like a single REGEX that will accomplish all of this.