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 REGEX_EMAIL = "^([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})(\\]?)$"; public static boolean isEmail(String str) { return regex(str, REGEX_EMAIL); }/*from w w w . j a v a 2 s . c o m*/ public static final boolean regex(String testStr, String regStr) { Pattern p = Pattern.compile(regStr); Matcher m = p.matcher(testStr); return m.matches(); } }