Java Email Validate validateEmail(String hex)

Here you can find the source of validateEmail(String hex)

Description

validate Email

License

Open Source License

Declaration

public static boolean validateEmail(String hex) 

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 {
    private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
            + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";

    public static boolean validateEmail(String hex) {
        Matcher matcher;/*from w w w.j a  v a 2s  . c o m*/
        Pattern pattern = Pattern.compile(EMAIL_PATTERN);
        matcher = pattern.matcher(hex);

        return matcher.matches();
    }
}

Related

  1. validateEmail(String email)
  2. validateEmail(String email)
  3. validateEmail(String email)
  4. validateEmail(String email)
  5. validateEmail(String email)
  6. validateEmail2(String field)
  7. validateEmailAddress(String address)
  8. validEmail(String canidate)
  9. validEmail(String email)