Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.text.TextUtils;

import java.util.regex.Pattern;

public class Main {

    public static boolean isEmailValid(String email) {
        if (TextUtils.isEmpty(email))
            return false;

        String regex = "^([a-z0-9_\\.-]{1,50})@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$";
        return Pattern.matches(regex, email);
    }
}