Java Email Validate checkEmailWithSuffix(String email)

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

Description

check Email With Suffix

License

Open Source License

Declaration

public static boolean checkEmailWithSuffix(String email) 

Method Source Code


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

public class Main {

    public static boolean checkEmailWithSuffix(String email) {
        String regex = "\\w+\\@\\w+\\.(com|cn|com.cn|net|org|gov|gov.cn|edu|edu.cn)";

        return startCheck(regex, email);
    }//from w w  w .jav  a  2s . c om

    public static boolean startCheck(String reg, String string) {
        boolean tem = false;

        Pattern pattern = Pattern.compile(reg);
        Matcher matcher = pattern.matcher(string);

        tem = matcher.matches();
        return tem;
    }
}

Related

  1. checkEmail(String email)
  2. checkEmail(String mail)
  3. checkEmailAddress(String address)
  4. checkEmailAddressNoEx(String inEmailAddress)
  5. checkEmailPattern(String email)
  6. cleanUpEmailAddress(CharSequence address)
  7. containsEmail(String chunk)
  8. extractEmail(String string, StringBuffer sb)
  9. extractEmailAddresses(final String text)