Here you can find the source of checkEmail(String email)
public static boolean checkEmail(String email)
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean checkEmail(String email) { String regex = "\\w+@\\w+\\.[a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)?"; return Pattern.matches(regex, email); }//from ww w . ja v a2s . co m }