Java tutorial
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static final String EMAIL_REGULAR = "^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$"; public static boolean isEmail(String email) { Pattern p = Pattern.compile(EMAIL_REGULAR); Matcher m = p.matcher(email); return m.matches(); } }