First of all, I know that using regex for email is not recommended but I gotta test this out.
I have this regex:
\\b[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]
You can checking if emails is valid or no by using this libreries, and of course you can add array for this folowing project.
import org.apache.commons.validator.routines.EmailValidator;
public class Email{
public static void main(String[] args){
EmailValidator email = EmailVlidator.getInstance();
boolean val = email.isValid("george.parcks@gmail.com");
System.out.println("Mail is: "+val);
val = email.isValid("hans.riguer.hotmsil.com");
System.out.print("Mail is: "+val");
}
}
output :
Mail is: true
Mail is : false