Java tutorial
//package com.java2s; //License from project: Apache License import java.util.regex.Pattern; public class Main { private final static Pattern EMAIL = Pattern.compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"); public static boolean isEmail(String email) { return !isEmpty(email) && EMAIL.matcher(email).matches(); } public static boolean isEmpty(String str) { return str == null || str.trim().length() == 0 || str.trim().equalsIgnoreCase("null"); } }