Java Email Validate validateEmailAddress(String address)

Here you can find the source of validateEmailAddress(String address)

Description

validate Email Address

License

Open Source License

Declaration

public static boolean validateEmailAddress(String address) 

Method Source Code


//package com.java2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static final String EMAIL_ADDRESS_REG_EXP = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";

    public static boolean validateEmailAddress(String address) {
        Pattern pattern = Pattern.compile(EMAIL_ADDRESS_REG_EXP);
        Matcher matcher = pattern.matcher(address);
        if (matcher.matches()) {
            return true;
        }/*from ww  w.j  a  va 2  s.c  om*/
        return false;
    }
}

Related

  1. validateEmail(String email)
  2. validateEmail(String email)
  3. validateEmail(String email)
  4. validateEmail(String hex)
  5. validateEmail2(String field)
  6. validEmail(String canidate)
  7. validEmail(String email)
  8. validEmail(String p_mail)
  9. validEmailAddrWithDataExact(String str)