Here you can find the source of isEmail(String str)
public static boolean isEmail(String str)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static final String EMAIL_PATTERN = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; public static boolean isEmail(String str) { return isMatcher(str, EMAIL_PATTERN); }//from w ww . ja v a2 s .com public static boolean isMatcher(String str, String pattern) { if (str == null) { return false; } if (pattern == null) { throw new IllegalArgumentException(); } Pattern pt = Pattern.compile(pattern); Matcher mc = pt.matcher(str); return mc.matches(); } }