Java Email Validate isValidEmail(String email)

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

Description

Validate if the given value is a valid Email address.

License

Open Source License

Parameter

Parameter Description
email the email to validate

Return

true if the provided value is a valid Email, false otherwise

Declaration

public static boolean isValidEmail(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 {
    /**//  ww w . j a va  2 s.  c o m
     * Validate if the given value is a valid Email address.
     * 
     * @param email
     *          the email to validate
     * @return <ii>true</ii> if the provided value is a valid Email, <ii>false</ii> otherwise
     */
    public static boolean isValidEmail(String email) {
        if (email == null) {
            return false;
        }

        Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
        Matcher m = p.matcher(email);
        return m.matches();
    }
}

Related

  1. isValidEmail(final String email)
  2. isValidEmail(String email)
  3. isValidEmail(String email)
  4. isValidEmail(String email)
  5. isValidEmail(String email)
  6. isValidEmail(String email)
  7. isValidEmail(String email)
  8. isValidEmail(String emailAddress)
  9. isValidEmail(String eMailAddress)