Please don't. 😆 Regexp is already a terrible choice for parsing all of the possible legal formats of email addresses, and the problem as stated doesn't really say which optional valid syntaxes you might encounter. One could just look at the test cases to figure that out, but it would be better if the problem either didn't use email addresses at all, or at least was explicit about what formats need to be supported.
Please don't. 😆 Regexp is already a terrible choice for parsing all of the possible legal formats of email addresses, and the problem as stated doesn't really say which optional valid syntaxes you might encounter. One could just look at the test cases to figure that out, but it would be better if the problem either didn't use email addresses at all, or at least was explicit about what formats need to be supported.