Java Email Validate isEmail(String value)

Here you can find the source of isEmail(String value)

Description

is Email

License

Open Source License

Declaration

public static boolean isEmail(String value) 

Method Source Code


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

public class Main {
    public static final Pattern EMAIL_ADDRESS_PATTERN = Pattern.compile(
            "\\b(^(\\S+@).+((\\.com)|(\\.net)|(\\.org)|(\\.info)|(\\.edu)|(\\.mil)|(\\.gov)|(\\.biz)|(\\.ws)|(\\.us)|(\\.tv)|(\\.cc)|(\\.aero)|(\\.arpa)|(\\.coop)|(\\.int)|(\\.jobs)|(\\.museum)|(\\.name)|(\\.pro)|(\\.travel)|(\\.nato)|(\\..{2,2}))$)\\b");

    public static boolean isEmail(String value) {
        Matcher matcher = EMAIL_ADDRESS_PATTERN.matcher(value);
        return matcher.matches();
    }//from  w  w w.  j  a  v  a  2 s.c  o  m
}

Related

  1. isEmail(String string)
  2. isEmail(String string)
  3. isEmail(String text)
  4. isEmail(String val)
  5. isEmail(String value)
  6. isEmailAddress(String input)
  7. isEmailAddressFormat(String address)
  8. isEmailAddressValid(String emailAddress)
  9. isEmailer(String email)