Java tutorial
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean isEmailOk(String s) { String regex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; Pattern pattern = Pattern.compile(regex); return pattern.matcher(s).matches(); } }