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 matchMobilNo(String num) {
        if (TextUtils.isEmpty(num)) {
            return false;
        }
        String reg = "^((13[0-9])|(14[5,7])|(15[^4,\\D])|(17[0,6,7])|(18[0-9]))\\d{8}$";
        Pattern pattern = Pattern.compile(reg);
        Matcher matcher = pattern.matcher(num);
        boolean flag = matcher.matches();
        return flag;
    }
}