title: Processing and replacing text inside double curly braces
body: <p>I have a URL string:</p>
  
  <p><code>var url = https://url.com/{{query}}/foo/{{query2}}</code></p>
  
  <p>I have a line of code that is able to take in a string, then get an array of all the queries inside the braces:</p>
  
  <p><code>var queries = String(url).match(/[^{\}]+(?=})/g);</code></p>
  
  <p>Returns:
  <code>queries = ['query', 'query2']</code></p>
  
  <p>I have a function, <code>parse(queries)</code>, which processes these queries and returns a list of their results:</p>
  
  <p><code>results = ['resultOfQuery', 'resultOfQuery2']</code></p>
  
  <p>I want to be able to take this list, and then replace the queries in the URL string with their results. The final result of this example would be:</p>
  
  <p><code>url = https://url.com/resultOfQuery/foo/resultOfQuery2</code></p>
  
  <p>I have two separate problems:</p>
  
  <ol>
  <li><p>The regex in the <code>String.match</code> line of code only counts for once set of curly braces, <code>{something}</code>. How can I modify it to look for a set of double curly braces, {{something}}?</p></li>
  <li><p>I already have the array of results. What is the best way to do the string replacement so that the queries and each of their accompanying set of double braces are replaced with their corresponding result?</p></li>
  </ol>