docs: public static final String isDate(String str, char delimiter)
      {
          int length = str.length();
          if ( length > 10 ) {
              return null;
          }
          
          int sIdx = 0, eIdx = 0, idx = 0;
          String[] parts = new String[]{null,null,null};
          while ( (eIdx = str.indexOf(delimiter, sIdx)) > -1 ) {
              parts[idx++] = str.substring(sIdx, eIdx);
              sIdx = eIdx + 1;
              if ( idx > 2 ) {
                  return null;
              }
          }
          
          if ( sIdx < length ) {
              parts[idx++] = str.substring(sIdx);
          }
          
          if ( idx < 2 || idx > 3 ) {
              return null;
          }
          
          String y, m, d = null;
          if ( idx == 2 ) {
              y = parts[0];
              m = parts[1];
          } else {
              y = parts[0];
              m = parts[1];
              d = parts[2];
          }
          
          //System.out.println(y+","+m+","+d);
          //year format check
          if ( y.length() != 4 || ! StringUtil.isDigit(y) 
                  || y.charAt(0) == '0' ) {
              return null;
          }
          
          //month format check
          int len = m.length();
          if ( len < 1 || len > 2 ) {
              return null;
          }
          
          if ( len == 1 ) {
              char chr = m.charAt(0);
              if ( chr < '1' || chr > '9' ) {
                  return null;
              }
          } else if ( len == 2 ) {
              char chr1 = m.charAt(0);
              char chr2 = m.charAt(1);
              if ( ! (chr1 == '0' || chr1 == '1') ) {
                  return null;
              }
              if ( chr1 == '0' ) {
                  if ( chr2 < '1' || chr2 > '9' ) {
                      return null;
                  }
              } else if ( chr2 < '0' || chr2 > '2' ) {
                  return null;
              }
          }
          
          //day format check
          if ( idx == 3 ) {
              len = d.length();
              if ( len < 1 || len > 2 ) {
                  return null;
              }
              
              if ( len == 1 ) {
                  char chr = d.charAt(0);
                  if ( chr < '1' || chr > '9' ) {
                      return null;
                  }
              } else if ( len == 2 ) {
                  char chr1 = d.charAt(0);
                  char chr2 = d.charAt(1);
                  if ( "0123".indexOf(chr1) == -1 ) {
                      return null;
                  }
                  if ( chr1 < '3' ) {
                      if ( chr2 < '1' && chr2 > '9' ) {
                          return null;
                      }
                  } else if ( chr2 < '0' || chr2 > '1' ) {
                      return null;
                  }
              }
          }
          
          if ( delimiter == '.' ) {
              return idx == 2 ? (y+"-"+m) : (y+"-"+m+"-"+d);
          }
          
          return str;
      }