code: func (v routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) {
  	// Store host variables.
  	if v.host != nil {
  		host := getHost(req)
  		matches := v.host.regexp.FindStringSubmatchIndex(host)
  		if len(matches) > 0 {
  			extractVars(host, matches, v.host.varsN, m.Vars)
  		}
  	}
  	path := req.URL.Path
  	if r.useEncodedPath {
  		path = req.URL.EscapedPath()
  	}
  	// Store path variables.
  	if v.path != nil {
  		matches := v.path.regexp.FindStringSubmatchIndex(path)
  		if len(matches) > 0 {
  			extractVars(path, matches, v.path.varsN, m.Vars)
  			// Check if we should redirect.
  			if v.path.options.strictSlash {
  				p1 := strings.HasSuffix(path, "/")
  				p2 := strings.HasSuffix(v.path.template, "/")
  				if p1 != p2 {
  					u, _ := url.Parse(req.URL.String())
  					if p1 {
  						u.Path = u.Path[:len(u.Path)-1]
  					} else {
  						u.Path += "/"
  					}
  					m.Handler = http.RedirectHandler(u.String(), http.StatusMovedPermanently)
  				}
  			}
  		}
  	}
  	// Store query string variables.
  	for _, q := range v.queries {
  		queryURL := q.getURLQuery(req)
  		matches := q.regexp.FindStringSubmatchIndex(queryURL)
  		if len(matches) > 0 {
  			extractVars(queryURL, matches, q.varsN, m.Vars)
  		}
  	}
  }
docs: // setMatch extracts the variables from the URL once a route matches.