replacer = function (match, p1, offset, string) {
      if (string[offset - 1] === '{' && string[offset + match.length + 1] !== '}') {
        return match;
      }
      return '{' + p1 + '}';
    }
Changes the {} around scheme and path variables to :variable
@param {string} url - the url string
@returns {string} string after replacing /{pet}/ with /:pet/