Android Email String Validate isEmailFormat(String email)

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

Description

is Email Format

License

Apache License

Declaration

public static boolean isEmailFormat(String email) 

Method Source Code

//package com.java2s;
/*//  w  w  w .  j a  v  a2  s.c  om
 * Copyright 1999-2101 Alibaba Group.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *      http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.regex.Pattern;

public class Main {
    public final static Pattern EMAIL_ADDRESS_PATTERN = Pattern
            .compile("[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" + "\\@"
                    + "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" + "(" + "\\."
                    + "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" + ")+");

    public static boolean isEmailFormat(String email) {
        return EMAIL_ADDRESS_PATTERN.matcher(email).matches();
    }
}

Related

  1. getNameFromEmail(String email)
  2. isLegalEmail(String email)
  3. isEmail(String str)
  4. isEmail(String email)
  5. isEmail(String text)
  6. isValidEmail(CharSequence target)
  7. isValidEmailAddress(String email)
  8. isEmailValid(CharSequence email)
  9. isEmail(String email)