// 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 TwoDigit {
    private static Pattern p = Pattern.compile("^[ ]*[\\d]+[.][\\d][\\d]$");
    private static void test(String s) {
        System.out.println(s + ": " + p.matcher(s).matches());
    }
    public static void main(String[] args) {
        test("12.34");
        test("1.2");
        test("123.456");
    }
}
