Java Email Validate isEmailValid(String emailAddress)

Here you can find the source of isEmailValid(String emailAddress)

Description

is Email Valid

License

Open Source License

Declaration

public static boolean isEmailValid(String emailAddress) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.regex.Pattern;
import java.util.regex.Matcher;

public class Main {
    public static boolean isEmailValid(String emailAddress) {
        try {/*from ww w .  j  av a2s .c  o  m*/
            //InternetAddress.parse(emailAddress);
            Pattern alpha = Pattern.compile("[a-zA-Z0-9]@([\\w-]+\\.)+[\\w-]{2,4}$");
            Matcher matcher = alpha.matcher(emailAddress.trim());
            if (matcher.find())
                return true;
        } catch (Exception ae) {
            return false;
        }
        return false;
    }
}

Related

  1. isEmailFormatValid(String emailAddress)
  2. isEmailValid(String address)
  3. isEmailValid(String email)
  4. isEmailValid(String email)
  5. isEmailValid(String email)
  6. isLegarEmail(String email)
  7. isMail(String email)
  8. isMobilesOrEmail(String str)
  9. isStrEmailAddress(String str)