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 {

    private static boolean match(String str, String rex) {
        if (null == str || str.trim().length() == 0) {
            return false;
        }
        Pattern pattern = Pattern.compile(rex);
        Matcher isNum = pattern.matcher(str);
        return isNum.matches();
    }
}