With regex it is correct only until you get 1 case that causes it to fail. In your case, if you have a finite set of e-mail addresses that the regex must
match and/or filter, then you just need to test with them. This is especially true with e-mail addresses as although there is a standard
that describes the valid syntax for e-mail addresses, it is too complicated, and it still doesn't filter out all invalid e-mail addresses. See How to Find or Validate an Email Address
for a full discussion on this. You may find the examples at Email address - Wikipedia, the free encyclopedia
to be useful if you're not given a set of e-mail addresses to test against. (An Internet search using the search term "example email address" will give you more.
Have you used/do you want to learn unit testing? From experience in professional software development, unit testing (using a framework such as JUnit or TestNG) is indispensable
when writing regexes. It not only gives you a way to quickly test all known success and failure cases, it also provides automatic regression testing whenever you need to modify the regex to ensure the modification doesn't break what used to work before.