Java - Write code to check if a string is Numeric by regex

Requirements

Write code to check if a string is Numeric by regex

Demo

//package com.book2s;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] argv) {
        String str = "book2s.com";
        System.out.println(isNumeric(str));
    }/*from   w w  w.  j av  a  2 s  .  com*/

    public static boolean isNumeric(String str) {
        Pattern pattern = Pattern.compile("[0-9]*");
        return pattern.matcher(str).matches();
    }
}