Here you can find the source of isEMailAddress(URL url)
public static boolean isEMailAddress(URL url)
//package com.java2s; //License from project: LGPL import java.net.URL; public class Main { public static boolean isEMailAddress(URL url) { boolean result = true; String urlString = url.toString(); if (url.getHost() != null && !url.getHost().trim().equals("")) { result = false;//from w w w .j av a 2s. co m } if (url.getPort() != -1) { result = false; } int pos = urlString.indexOf('@'); if (pos == -1) { result = false; } else { // check for a second '@' sign if (urlString.indexOf('@', pos + 1) != -1) { return false; } } // check if the host is possible if (pos > (urlString.length() - 6)) { result = false; } return result; } }