Here you can find the source of isEmail(String str)
public static boolean isEmail(String str)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isEmail(String str) { boolean result = validByRegex( "^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$", str); return result; }//from w w w . j a v a2s.c om public static boolean validByRegex(String regex, String str) { Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); Matcher regexMatcher = pattern.matcher(str); return regexMatcher.find(); } }