Java tutorial
//package com.java2s; public class Main { private static final String EMAIL_REGEXP = "^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$"; public static boolean isValidEmailAddress(String email) { return email.matches(EMAIL_REGEXP); } }