Java Email Validate isValidEmail(String email)

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

Description

is Valid Email

License

Open Source License

Declaration

public static boolean isValidEmail(String email) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static boolean isValidEmail(String email) {
        boolean err = false;
        String regex = "^[_a-z0-9-]+(.[_a-z0-9-]+)*@(?:\\w+\\.)+\\w+$";
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(email);
        if (m.matches()) {
            err = true;/*from   www .j a v  a 2 s  . c  o m*/
        }
        return err;
    }
}

Related

  1. isMobilesOrEmail(String str)
  2. isStrEmailAddress(String str)
  3. isValidEmail(final String email)
  4. isValidEmail(final String email)
  5. isValidEmail(String email)
  6. isValidEmail(String email)
  7. isValidEmail(String email)
  8. isValidEmail(String email)
  9. isValidEmail(String email)