Here you can find the source of checkEmailAddressNoEx(String inEmailAddress)
public static boolean checkEmailAddressNoEx(String inEmailAddress)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean checkEmailAddressNoEx(String inEmailAddress) { boolean status = false; String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(inEmailAddress); status = m.find();//from w w w . j ava 2s . co m if (status == true) { String[] parts = inEmailAddress.split("@"); String localPart = parts[0]; String domainPart = parts[1]; if (localPart.length() > 255 || domainPart.length() > 64) { status = false; } } return status; } }