Java tutorial
//package com.java2s; public class Main { public static final boolean isEmail(String str) { if (isBlank(str)) { return false; } return str.matches("^[a-zA-Z0-9_.]+@[a-zA-Z0-9-]+[.a-zA-Z]+$"); } private static boolean isBlank(String str) { if (str == null || str.matches("[ ]{0,}")) { return true; } return false; } }