function combineRegexes(...regexes) {
  const full = regexes.reduce((f, r) => f + r.source, "");
  return RegExp(`^${full}$`);
}
function combineRegexes(...regexes) {
  const full = regexes.reduce((f, r) => f + r.source, "");
  return RegExp(`^${full}$`);
}
function combineRegexes ( ... regexes ) { const full = regexes . reduce ( ( f , r ) => f + r . source , "" ) ; return RegExp ( ` ${ full } ` ) ; }
/*
This file handles parsing for well-specified formats. Here's how it works:
Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.
An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object
parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.
Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors.
combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.
Some extractions are super dumb and simpleParse and fromStrings help DRY them.
/ * This file handles parsing for well - specified formats . Here s how it works : Two things go into parsing : a regex to match with and an extractor to take apart the groups in the match . An extractor is just a function that takes a regex match array and returns a { year : ... month : ... } object parse () does the work of executing the regex and applying the extractor . It takes multiple regex / extractor pairs to try in sequence . Extractors can take a cursor representing the offset in the match to look at . This makes it easy to combine extractors . combineExtractors () does the work of combining them keeping track of the cursor through multiple extractions . Some extractions are super dumb and simpleParse and fromStrings help DRY them .
Combine multiple regular expressions into one