code: func (r *Route) addRegexpMatcher(tpl string, typ regexpType) error {
  	if r.err != nil {
  		return r.err
  	}
  	if typ == regexpTypePath || typ == regexpTypePrefix {
  		if len(tpl) > 0 && tpl[0] != '/' {
  			return fmt.Errorf("mux: path must start with a slash, got %q", tpl)
  		}
  		if r.regexp.path != nil {
  			tpl = strings.TrimRight(r.regexp.path.template, "/") + tpl
  		}
  	}
  	rr, err := newRouteRegexp(tpl, typ, routeRegexpOptions{
  		strictSlash:    r.strictSlash,
  		useEncodedPath: r.useEncodedPath,
  	})
  	if err != nil {
  		return err
  	}
  	for _, q := range r.regexp.queries {
  		if err = uniqueVars(rr.varsN, q.varsN); err != nil {
  			return err
  		}
  	}
  	if typ == regexpTypeHost {
  		if r.regexp.path != nil {
  			if err = uniqueVars(rr.varsN, r.regexp.path.varsN); err != nil {
  				return err
  			}
  		}
  		r.regexp.host = rr
  	} else {
  		if r.regexp.host != nil {
  			if err = uniqueVars(rr.varsN, r.regexp.host.varsN); err != nil {
  				return err
  			}
  		}
  		if typ == regexpTypeQuery {
  			r.regexp.queries = append(r.regexp.queries, rr)
  		} else {
  			r.regexp.path = rr
  		}
  	}
  	r.addMatcher(rr)
  	return nil
  }
docs: // addRegexpMatcher adds a host or path matcher and builder to a route.