isMetricWithPattern = nestedRegexp => {
  const pattern = `^([1-9][0-9]*[kMGTPEZY]?|[1-9]\\.[1-9][kMGTPEZY])${nestedRegexp.source}$`
  const regexp = new RegExp(pattern)
  return withRegex(regexp)
}
@param {RegExp} nestedRegexp Pattern that must appear after the metric.
@returns {Function} A function that returns a RegExp that matches a metric followed by another pattern.