Here you can find the source of checkEmail(String mail)
public static boolean checkEmail(String mail)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean checkEmail(String mail) { String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(mail); return m.find(); }/* w w w .j a va2 s . c o m*/ }