// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.regex.Pattern;

public class RegexMatch {
    private static Pattern p = Pattern.compile("\\d{1,3}\\.\\d{1,7}");
    public static boolean is37digit(String s)
    {
        return p.matcher(s).matches();
    }
    public static void main(String[] args) {
        System.out.println(is37digit("123.456"));
        System.out.println(is37digit("123.4567899"));
        System.out.println(is37digit("1123.4567899"));
    }
}
