func removePrefixes(r *regexp.Regexp, num int) (result *regexp.Regexp) {
	path := strings.TrimLeft(r.String(), "/")
	paths := strings.Split(path, "/")
	result = regexp.MustCompile("/" + strings.Join(paths[num:], "/"))
	return
}
func removePrefixes(r *regexp.Regexp, num int) (result *regexp.Regexp) {
	path := strings.TrimLeft(r.String(), "/")
	paths := strings.Split(path, "/")
	result = regexp.MustCompile("/" + strings.Join(paths[num:], "/"))
	return
}
// Removes the specified number of prefixes from a regexp and returns a new regexp.
// This basically loosens validations on the regexp by making the specified number of
// prefixes optional. num must be greater than the number of prefixes. For example:
// r.String()                       // => "/api/catalog/collections/([^/]+)/templates/actions/dependencies"
// removePrefixes(&r, 2).String()   // => "/collections/([^/]+)/templates/actions/dependencies"