Java Email Validate isValidEmailAdress(String email)

Here you can find the source of isValidEmailAdress(String email)

Description

returns true if the specified email is well formatted

License

Open Source License

Parameter

Parameter Description
email a parameter

Declaration

public static boolean isValidEmailAdress(String email) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * This file is part of ISPyB.//www .  j  a  v  a  2s  .c om
 * 
 * ISPyB is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ISPyB is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with ISPyB.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Contributors : S. Delageniere, R. Leal, L. Launer, K. Levik, S. Veyrier, P. Brenchereau, M. Bodin, A. De Maria Antolinos
 ******************************************************************************/

import java.util.regex.Pattern;

public class Main {
    /**
     * returns true if the specified email is well formatted
     * 
     * @param email
     * @return
     */
    public static boolean isValidEmailAdress(String email) {
        return Pattern.matches("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)+$", email.toLowerCase());
    }
}

Related

  1. isValidEmailAddress(String emailAddress)
  2. isValidEmailAddress(String emailAddress)
  3. isValidEmailAddress(String emailAddress)
  4. isValidEmailAddress(String emailAddress)
  5. isValidEmailAddress(String emailAddress)
  6. parseEmail(String target)
  7. validateEmail(String email)
  8. validateEmail(String email)
  9. validateEmail(String email)