Java Email Validate checkEmail(String email)

Here you can find the source of checkEmail(String email)

Description

check Email

License

Open Source License

Declaration

public static boolean checkEmail(String email) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.regex.Pattern;

public class Main {
    public static boolean checkEmail(String email) {
        Pattern rfc2822 = Pattern.compile(
                "^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$");
        return rfc2822.matcher(email).matches();
    }/*from   w  ww  .j ava2s  .  com*/
}

Related

  1. baseAddress(String email)
  2. checkEmail(String email)
  3. checkEmail(String email)
  4. checkEmail(String email)
  5. checkEmail(String mail)