Here you can find the source of validateEmail(String hex)
public static boolean validateEmail(String hex)
//package com.java2s; //License from project: Open Source License import java.util.regex.Pattern; import java.util.regex.Matcher; public class Main { private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; public static boolean validateEmail(String hex) { Matcher matcher;/*from w w w.j a v a 2s . c o m*/ Pattern pattern = Pattern.compile(EMAIL_PATTERN); matcher = pattern.matcher(hex); return matcher.matches(); } }