Java Email Validate isEmail(String email)

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

Description

Valid Email

License

Open Source License

Parameter

Parameter Description
email a parameter

Declaration

public static boolean isEmail(String email) 

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 {
    /**/*w ww.ja  v a 2 s  . c om*/
     * Valid Email
     * @param email
     * @return
     */
    public static boolean isEmail(String email) {
        String str = "^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$";
        Pattern p = Pattern.compile(str);
        Matcher m = p.matcher(email);
        return m.matches();
    }
}

Related

  1. isEmail(String correo)
  2. isEmail(String data)
  3. isEmail(String email)
  4. isEmail(String email)
  5. isEmail(String email)
  6. isEmail(String email)
  7. isEmail(String email)
  8. isEmail(String emailAddress)
  9. isEmail(String input)