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