Java Email Validate isEmail(String str)

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

Description

Validasi alamat email

License

Open Source License

Parameter

Parameter Description
str String email yang akan divalidasi

Return

boolean true jika valid, sebaliknya false

Declaration

public static boolean isEmail(String str) 

Method Source Code

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

import java.util.regex.Pattern;

public class Main {
    /**/*w  w w  .  j  av a  2  s. c  o m*/
     * Validasi alamat email
     * @param str String email yang akan divalidasi
     * @return boolean true jika valid, sebaliknya false
     */
    public static boolean isEmail(String str) {
        return Pattern.matches("^([\\w-]+)@([\\w-]+\\.)+[A-Za-z]{2,3}$",
                str);
    }
}

Related

  1. isEmail(String s)
  2. isEmail(String str)
  3. isEmail(String str)
  4. isEmail(String str)
  5. isEmail(String str)
  6. isEmail(String str)
  7. isEmail(String str, boolean nullCheck)
  8. isEmail(String string)
  9. isEmail(String string)