Here you can find the source of checkEmailPattern(String email)
public static boolean checkEmailPattern(String email)
//package com.java2s; import java.util.regex.Pattern; import java.util.regex.Matcher; public class Main { public static boolean checkEmailPattern(String email) { boolean status; String emailPattern = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*"; emailPattern += "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+"; emailPattern += "(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)"; Pattern p = Pattern.compile(emailPattern); Matcher m = p.matcher(email); status = m.matches();/*from w w w. ja v a 2 s .c o m*/ return status; } }