Java Email Validate isValidEmail(String email)

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

Description

is Valid Email

License

Apache License

Declaration

public static boolean isValidEmail(String email) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.regex.Pattern;

public class Main {
    private static Pattern EMAIL_PATTERN = Pattern
            .compile("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"
                    + "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[a-z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\\b");

    public static boolean isValidEmail(String email) {
        if (email != null) {
            return EMAIL_PATTERN.matcher(email.trim().toLowerCase()).matches();
        }//from  www . ja  v a2s .  c o m
        return true;
    }
}

Related

  1. isStrEmailAddress(String str)
  2. isValidEmail(final String email)
  3. isValidEmail(final String email)
  4. isValidEmail(String email)
  5. isValidEmail(String email)
  6. isValidEmail(String email)
  7. isValidEmail(String email)
  8. isValidEmail(String email)
  9. isValidEmail(String email)