Here you can find the source of isValidEmail(String email)
public static boolean isValidEmail(String email)
//package com.java2s; //License from project: Apache License import java.util.regex.Pattern; public class Main { private static Pattern EMAIL_PATTERN = Pattern .compile("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[a-z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\\b"); public static boolean isValidEmail(String email) { if (email != null) { return EMAIL_PATTERN.matcher(email.trim().toLowerCase()).matches(); }//from www . ja v a2s . c o m return true; } }