Here you can find the source of isEmail(String str)
Parameter | Description |
---|---|
str | String email yang akan divalidasi |
public static boolean isEmail(String str)
//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); } }