Java - Write code to check if a string is Number using regex

Requirements

Write code to check if a string is Number using regex

Demo

//package com.book2s;

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

public class Main {
    public static void main(String[] argv) {
        String numStr = "book2s.com";
        System.out.println(isNumber(numStr));
    }/*from   ww  w . j  a v a2 s.  c om*/

    public static boolean isNumber(String numStr) {
        if (isEmpty(numStr))
            return false;
        Pattern pattern = Pattern.compile("[0-9]*");
        Matcher match = pattern.matcher(numStr);
        return match.matches();
    }

    public static boolean isEmpty(CharSequence s) {
        return s == null || s.length() == 0;
    }
}