Here you can find the source of isMail(String email)
public static boolean isMail(String email)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static final String CHECK_MAIL = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; public static boolean isMail(String email) { return check(CHECK_MAIL, email); }// w ww . j a v a 2 s. c o m private static boolean check(String _regex, CharSequence _input) { Pattern regex = Pattern.compile(_regex); Matcher matcher = regex.matcher(_input); boolean isMatched = matcher.matches(); return isMatched; } }