Java Check whether a String is a literal double number

Java Check whether a String is a literal double number
/**
 * @author lautturi.com
 * Java example: how to check if string is double or not in java
 */

import java.util.*;
import java.util.regex.Pattern;

public class Lautturi {
	public static void main(String[] args) {

		String decimalPattern = "([0-9]*)\\.([0-9]*)";  
		String number="3.1415";  
		boolean match = Pattern.matches(decimalPattern, number);
		//if true then decimal
		if(match) {
			System.out.println("It's a literal double number"); 
		}
		
	}
}
Source:‮al.www‬utturi.com

output:

literal double number
Created Time:2017-09-02 22:22:30  Author:lautturi