Android Email String Validate isEmail(String string)

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

Description

is Email

Declaration

public static boolean isEmail(String string) 

Method Source Code

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

public class Main {

    public static boolean isEmail(String string) {
        Pattern pattern = Pattern
                .compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
        Matcher matcher = pattern.matcher(string);
        if (matcher.find()) {
            return true;
        } else {/*from w w w .j  av a 2 s  .c  om*/
            return false;
        }
    }
}

Related

  1. isEmail(String email)
  2. validEmail(String email)
  3. checkEmail(String email)
  4. isEmail(String str)
  5. isEmail(String strEmail)
  6. isEmail(String strEmail)
  7. getNameFromEmail(String email)
  8. isLegalEmail(String email)
  9. isEmail(String str)