code: public Integer extractArchiveDateCount(String datePattern) {
          int dateCount = 0;
          String[] splits = datePattern.split("d|M|y");
          if (splits.length > 0) {
              dateCount = dateCount + Integer.valueOf(splits[0]);
          }
          if (splits.length > 1) {
              dateCount = dateCount + (Integer.valueOf(splits[1]) * 30);
          }
          if (splits.length > 2) {
              dateCount = dateCount + (Integer.valueOf(splits[2]) * 365);
          }
          return dateCount;
      }
docs: Extract archive date count.
  
  @param datePattern
  the date pattern
  @return the integer