// 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 NumberMatch {
    private static Pattern p = Pattern.compile("^[0-9]\\.[0-9][0-9]$");
    private static boolean match(String s) {
        return p.matcher(s).matches();
    }
    public static void main(String[] args) {
        System.out.println(match("1.23"));
        System.out.println(match("1.234"));
        System.out.println(match("01.23"));
        System.out.println(match("1.2"));
        System.out.println(match("ABC"));
        System.out.println(match("1.X3"));
    }
}
