title: parse url to get id using javascript regex
body: <p>I am writing a router which will parse the url and redirect to necessary components in the code, when I change my url and pass object id with it, I want to parse it using regular expression and route it to get that object by id.</p>
  
  <pre><code>mysite.com/blah#path=folder/?folderId=klafjlka
  </code></pre>
  
  <p>How do I parse this url using javscript regex and route it to that folder </p>
  
  <p>With reference to backbone, I want to write a code which does this, but I'm not using backbone</p>
  
  <pre><code>routes : { "folder/:id" : "handler" },
  </code></pre>