code: func (a IndexRules) Match(metric string) (uint16, IndexRule) {
  	for i, s := range a.Rules {
  		if s.Pattern.MatchString(metric) {
  			return uint16(i), s
  		}
  	}
  	return uint16(len(a.Rules)), a.Default
  }
docs: // Match returns the correct index rule setting for the given metric
  // it can always find a valid setting, because there's a default catch all
  // also returns the index of the setting, to efficiently reference it