Here you can find the source of isEmailValid(String email)
public static boolean isEmailValid(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 final String REGEX_EMAIL = "^[\\w_.\\-]+@([a-zA-Z0-9_\\-]+?\\.){1,3}[a-zA-Z]{2,3}$"; /**// w w w . j av a 2 s.c om * Return true if Email has a valid format */ public static boolean isEmailValid(String email) { if (email == null) { return false; } Pattern pattern = Pattern.compile(REGEX_EMAIL); Matcher matcher = pattern.matcher(email); return matcher.matches(); } }