// 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.*;

public class FormatCheck2 {
    public static void main(String[] args) {
        System.out.println(match("06/10/2003"));
        System.out.println(match("10-06-2003"));
    }
    private static Pattern p = Pattern.compile("[0-9]+/[0-9]+/[0-9]+");
    private static boolean match(String ds) {
        return p.matcher(ds).matches();
    }
}
