function parseMonthString(str) {
  const matches = monthRe.exec(str);
  if (!matches) {
    return null;
  }
  const year = Number(matches[1]);
  if (year <= 0) {
    return null;
  }
  const month = Number(matches[2]);
  if (month < 1 || month > 12) {
    return null;
  }
  return { year, month };
}