Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static boolean isMobilePhoneNumber(String phoneNumber) {
        //  /^0{0,1}(13[4-9]|15[7-9]|15[0-2]|18[7-8])[0-9]{8}$/; 
        String reg_VerCode = "^(13|14|15|18)[0-9]{9}$";

        Pattern p = Pattern.compile(reg_VerCode);
        Matcher m = p.matcher(phoneNumber);
        return m.matches();
    }
}