title: Returning all of the specified integers from a string into an array
body: <p>The URL query after a <code>decodeURIComponent</code> and a <code>split()</code> looks like this <code>["pcs_availability:Online", "price:[1500 TO 1999.99]"]</code> the results I am looking for is returning an array with the proper integer like <code>[1999.99]</code>. But there can be more than 1 price range in URL query string for example <code>["pcs_availability:Online", "price:[250 TO 499.99]:[500 TO 999.99]:[1500 TO 1999.99]"]</code>. Which should return <code>[499.99, 999.99, 1999.99]</code>. I forgot to mention that the price positioning in the array could be different depending on the other URL queries. So that it's not always going to be guaranteed to be in the same spot.</p>
  
  <p>This was the approach taken.</p>
  
  <pre><code>const pattern = /^price:{1,2}\[.*? TO (.*)]$/;
  const price = query
    .map(q =&gt; {
      const match = pattern.exec(q);
      return match;
    });
  </code></pre>
  
  <p>Which returns this. I tried modifying the regex but unfortunately I haven't been able to get the results that I am looking  for.</p>
  
  <pre><code>["price:[250 TO 499.99]:[500 TO 999.99]:[1500 TO 1999.99]", "1999.99", index: 0, input: "price:[250 TO 499.99]:[500 TO 999.99]:[1500 TO 1999.99]", groups: undefined]
  </code></pre>