Java Email Validate isMail(String email)

Here you can find the source of isMail(String email)

Description

is Mail

License

Open Source License

Declaration

public static boolean isMail(String email) 

Method Source Code


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

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

public class Main {

    public static final String CHECK_MAIL = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";

    public static boolean isMail(String email) {
        return check(CHECK_MAIL, email);
    }//  w  ww  . j  a v  a 2  s. c o  m

    private static boolean check(String _regex, CharSequence _input) {
        Pattern regex = Pattern.compile(_regex);
        Matcher matcher = regex.matcher(_input);
        boolean isMatched = matcher.matches();
        return isMatched;
    }
}

Related

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