Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.regex.Pattern;

public class Main {
    public static boolean checkMobile(String mobile) {
        //String regex = "1[34578]\\d{9}$";
        String regex2 = "^(((1[3,8][0-9])|(17(0|3|[5-8]))|(14[4,5,7,9])|(15([0-3]|[5-9])))\\d{8})$";
        return Pattern.matches(regex2, mobile);
    }
}