Java Email Validate checkEmailAddressNoEx(String inEmailAddress)

Here you can find the source of checkEmailAddressNoEx(String inEmailAddress)

Description

check Email Address No Ex

License

Open Source License

Declaration

public static boolean checkEmailAddressNoEx(String inEmailAddress) 

Method Source Code

//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;

    }
}

Related

  1. checkEmail(String email)
  2. checkEmail(String email)
  3. checkEmail(String email)
  4. checkEmail(String mail)
  5. checkEmailAddress(String address)
  6. checkEmailPattern(String email)
  7. checkEmailWithSuffix(String email)
  8. cleanUpEmailAddress(CharSequence address)
  9. containsEmail(String chunk)