Here you can find the source of isEmail(String val)
public static boolean isEmail(String val)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static final String EMAIL_REGEXP = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$"; public static boolean isEmail(String val) { boolean result = false; Pattern p = Pattern.compile(EMAIL_REGEXP); Matcher m = p.matcher(val); try {//from w ww. ja v a2s . c o m return m.matches(); } catch (Exception e) { e.printStackTrace(); } return result; } }