title: how to extract parameter(specified pattern string) from string in javascript
body: <p>I need to extract parameter name from the url path.
  parameters are inside {} or follow the first ?(questionmark) or follow &amp; mark in the url.</p>
  
  <p>the url path need to be extracted is in such format :</p>
  
  <pre><code>/tt/{pa}/{pb}/?p1=9888&amp;p2=9&amp;p3=98
  </code></pre>
  
  <p>thus the parameters are  <code>pa</code>, <code>pb</code>,<code>p1</code>,<code>p1</code>,<code>p3</code></p>