Java tutorial
//package com.java2s; public class Main { /** * Validates the email. * @param email - Email. * @return - True (if is valid) or False (otherwise). */ public static boolean validateEmail(String email) { if (email == null || email.length() == 0 || !email.matches( "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")) return false; return true; } }