Verify email in Java

后端 未结 9 1495
长发绾君心
长发绾君心 2020-12-02 11:27

Is there any way to verify in Java code that an e-mail address is valid. By valid, I don\'t just mean that it\'s in the correct format (someone@domain.subdomain), but that\'

9条回答
  •  没有蜡笔的小新
    2020-12-02 12:07

    public static boolean isValidEmail(String emailAddress) {
        return emailAddress.contains(" ") == false && emailAddress.matches(".+@.+\\.[a-z]+");
    } 
    

提交回复
热议问题