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.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static boolean isPhoneNumber(String phoneNumber) {
        if (phoneNumber == null)
            return false;
        if (TextUtils.isEmpty(phoneNumber))
            return false;
        Pattern pattern = Pattern.compile("^(86|\\+86)?[1][3,4,5,8][0-9]{9}$");
        Matcher m = pattern.matcher(phoneNumber);
        return m.matches();
    }
}