Java Email Validate isLegarEmail(String email)

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

Description

is Legar Email

License

LGPL

Declaration

public static boolean isLegarEmail(String email) 

Method Source Code

//package com.java2s;
/**//ww w  .j  a  v  a2 s . c  o m
 *
 * Methods Descrip:Converts a line of text into an array of lower case words
 * using a BreakIterator.wordInstance().
 * <p>
 *
 * This method is under the Jive Open Source Software License and was
 * written by Mark Imbriaco.
 *
 * @param text
 *            a String of text to convert into an array of words
 * @return text broken up into an array of words.
 *
 */

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

public class Main {

    public static boolean isLegarEmail(String email) {
        boolean flag = false;
        // Pattern p =
        // Pattern.compile("[A-Za-z0-9]*@[A-Za-z0-9]+([.|-][A-Za-z0-9]+)*[.][A-Za-z0-9]+$");
        Pattern p = Pattern.compile("^\\w[-._\\w]*\\w@\\w[-._\\w]*\\w\\.\\w{2,6}$");
        Matcher m = p.matcher(email);
        flag = m.matches();

        return flag;
    }
}

Related

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