Here you can find the source of isValidEmail(String email)
public static boolean isValidEmail(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 isValidEmail(String email) { boolean err = false; String regex = "^[_a-z0-9-]+(.[_a-z0-9-]+)*@(?:\\w+\\.)+\\w+$"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(email); if (m.matches()) { err = true;/*from www .j a v a 2 s . c o m*/ } return err; } }