public static boolean correctISBNFormat(String isbn) {
        String regex = "\\d+";
        if (isbn.length() == 10) return isbn.matches(regex);
        
        if (isbn.length() == 14) {
            String i[] = isbn.split("\\-");
            if (i[0].length() != 3) return false;
            return i[0].matches(regex) && correctISBNFormat(i[1]);
        }
        
        return false;
    }