Here you can find the source of isEmailFormatValid(String emailAddress)
public static boolean isEmailFormatValid(String emailAddress)
//package com.java2s; import java.util.regex.Pattern; public class Main { /**//from w ww .ja v a 2s .com * Checks if is email format valid. * * @param emailAddress the email address * @return true, if is email format valid */ private static final Pattern emailPattern = Pattern.compile("^([a-zA-Z0-9_\\-\\.]+)(@[a-zA-Z0-9_\\-\\.]+)$"); public static boolean isEmailFormatValid(String emailAddress) { if (emailAddress == null || emailAddress.trim().length() == 0) throw new IllegalArgumentException("Do not empty email address to this method."); return emailPattern.matcher(emailAddress).matches(); } }