function combinePatterns(patterns) {
  return patterns.map(p => `(?:${p.source})`).join('|');
}
Combines an array of regular expressions into a single expression, wrapping
each in a non-capturing group and interposing alternation characters (|) so
that each expression is executed separately.