Here you can find the source of isEmail(String data)
public static boolean isEmail(String data)
//package com.java2s; import java.util.regex.*; public class Main { public static final String REGEX_IS_EMAIL = "^[a-zA-Z0-9][a-zA-Z0-9_.]*@\\w+([.][a-zA-Z]+)+$"; /**/*w w w . j a va2s .c o m*/ * @return boolean whether the String is a email address */ public static boolean isEmail(String data) { return isMatchRegex(data, REGEX_IS_EMAIL); } /** * * @param data the String testing match the regex * @param regex the String regex * @return whether the string match the regex */ private static boolean isMatchRegex(String data, String regex) { Pattern p = Pattern.compile(regex); Matcher matcher = p.matcher(data); if (matcher.find()) { return true; } else { return false; } } }