Here you can find the source of isEmail(String email)
public static boolean isEmail(String email)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isEmail(String email) { if (isEmpty(email)) { return false; }//from ww w.ja va 2s.c o m String str = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; Pattern p = Pattern.compile(str); Matcher m = p.matcher(email); return m.matches(); } public static boolean isEmpty(String string) { if (string == null || "".equals(string.trim())) { return true; } return false; } }