Here you can find the source of validateEmail(String email)
public static Boolean validateEmail(String email)
//package com.java2s; //License from project: LGPL import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static Boolean validateEmail(String email) { String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; Pattern pattern;//from w ww. ja va2 s .c om Matcher matcher; pattern = Pattern.compile(EMAIL_PATTERN); matcher = pattern.matcher(email); if (email == null || "".equals(email) || !matcher.matches()) { return false; } return false; } }