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]
String emailRegex = "[a-zA-Z0-9_.]+@[a-zA-Z0-9]+.[a-zA-Z]{2,3}[.] {0,1}[a-zA-Z]+";
Pattern.matches(emailRegex,"You_Input_Mail_Id");
This is the regex to match valid email addresses.
you can use a simple regular expression for validating email id,
public boolean validateEmail(String email){
return Pattern.matches("[_a-zA-Z1-9]+(\\.[A-Za-z0-9]*)*@[A-Za-z0-9]+\\.[A-Za-z0-9]+(\\.[A-Za-z0-9]*)*", email)
}
Description :