Java tutorial
//package com.java2s; public class Main { public static boolean isEmail(String str) { String regularExpression = "^([a-z0-9A-Z]+[-|//.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?//.)+[a-zA-Z]{2,}$"; if (isEmpty(str)) { return false; } else if (!str.matches(regularExpression)) { return false; } return true; } public static boolean isEmpty(String str) { if (str != null && !"".equals(str.trim())) { return false; } return true; } }