Android Email String Validate isEmail(String email)

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

Description

if email is valid

License

Apache License

Parameter

Parameter Description
email a parameter

Declaration

public static boolean isEmail(String email) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.regex.Pattern;

public class Main {
    private final static Pattern emailer = Pattern
            .compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");

    /**//from w  w w .j ava2 s. c  om
     * if email is valid
     *
     * @param email
     * @return
     */
    public static boolean isEmail(String email) {
        if (email == null || email.trim().length() == 0)
            return false;
        return emailer.matcher(email).matches();
    }
}

Related

  1. isEmail(String string)
  2. isEmail(String strEmail)
  3. getNameFromEmail(String email)
  4. isLegalEmail(String email)
  5. isEmail(String str)
  6. isEmail(String text)
  7. isEmailFormat(String email)
  8. isValidEmail(CharSequence target)
  9. isValidEmailAddress(String email)