Here you can find the source of isValidEmailAddress(String email)
Parameter | Description |
---|---|
an email address to check |
public static boolean isValidEmailAddress(String email)
//package com.java2s; public class Main { public static final String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; /**/*w ww. j a va 2 s . c o m*/ * Validates an email address * * @param email * an email address to check * @return true if email address is valid otherwise return false. */ public static boolean isValidEmailAddress(String email) { return email.matches(EMAIL_REGEX) && !email.trim().equals("") && !email.startsWith(" ") && !email.endsWith(" "); } }