Here you can find the source of validateEmail(String email)
public static boolean validateEmail(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 boolean validateEmail(String email) { Pattern p = Pattern.compile(".+@.+\\.[a-z]+"); Matcher m = p.matcher(email); boolean matchFound = m.matches(); if (matchFound) { return true; } else {/*from w w w .ja v a 2 s.co m*/ return false; } } }