function sanitizeUrlPathParams (reqUrl, pathVars) {
  var matches,
    collectionVars = [];

  // converts all the of the following:
  // /{{path}}/{{file}}.{{format}}/{{hello}} => /:path/{{file}}.{{format}}/:hello
  matches = utils.findPathVariablesFromPath(reqUrl);
  if (matches) {
    matches.forEach((match) => {
      const replaceWith = match.replace(/{{/g, ':').replace(/}}/g, '');
      reqUrl = reqUrl.replace(match, replaceWith);
    });
  }

  // Separates pathVars array and collectionVars.
  matches = utils.findCollectionVariablesFromPath(reqUrl);
  if (matches) {
    matches.forEach((match) => {
      const collVar = match.replace(/{{/g, '').replace(/}}/g, '');

      pathVars = pathVars.filter((item) => {
        if (item.name === collVar) {
          collectionVars.push(item);
        }
        return !(item.name === collVar);
      });
    });
  }

  return { url: reqUrl, pathVars, collectionVars };
}
Separates out collection and path variables from the reqUrl

@param {string} reqUrl Request Url
@param {Array} pathVars Path variables

@returns {Object} reqUrl, updated path Variables array and collection Variables.