Android Email String Validate isValidEmailAddress(String email)

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

Description

Validates an email address

Parameter

Parameter Description
email an email address to check

Return

true if email address is valid otherwise return false.

Declaration

public static boolean isValidEmailAddress(String email) 

Method Source Code

//package com.java2s;

public class Main {
    public static final String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";

    /**/*w ww.  j a  va 2 s  .  c  o  m*/
     * Validates an email address
     * 
     * @param email
     *            an email address to check
     * @return true if email address is valid otherwise return false.
     */
    public static boolean isValidEmailAddress(String email) {
        return email.matches(EMAIL_REGEX) && !email.trim().equals("")
                && !email.startsWith(" ") && !email.endsWith(" ");
    }
}

Related

  1. isEmail(String str)
  2. isEmail(String email)
  3. isEmail(String text)
  4. isEmailFormat(String email)
  5. isValidEmail(CharSequence target)
  6. isEmailValid(CharSequence email)
  7. isEmail(String email)
  8. isEmail(String str)
  9. isEmailValid(String email)