code: func matches(re *regexp.Regexp, filename, template string) (match bool, origin string) {
  	base := path.Base(filename)
  
  	matches := re.FindStringSubmatchIndex(base)
  	if matches == nil {
  		return false, ""
  	}
  
  	by := re.ExpandString(nil, template, base, matches)
  	if by == nil {
  		return false, ""
  	}
  
  	origin = dns.Fqdn(string(by))
  
  	return true, origin
  }
docs: // matches matches re to filename, if is is a match, the subexpression will be used to expand
  // template to an origin. When match is true that origin is returned. Origin is fully qualified.