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 isMobileValid(String mobile) {
        if (TextUtils.isEmpty(mobile) || !TextUtils.isDigitsOnly(mobile)) {
            return false;
        }

        return Pattern.matches("^(\\+86)?(1[3-9][0-9])\\d{8}$", mobile);
    }
}