title: Regex to get parts of URL
body: <p>Hi I have URL as follows:</p>
  
  <ul>
  <li>vimeo.com/99612902</li>
  <li>www.vimeo.com/99612902</li>
  <li><a href="http://vimeo.com/99612902" rel="nofollow">http://vimeo.com/99612902</a></li>
  <li><a href="http://www.vimeo.com/99612902" rel="nofollow">http://www.vimeo.com/99612902</a></li>
  <li><a href="http://vimeo.com/moogaloop.swf?clip_id=81368903" rel="nofollow">http://vimeo.com/moogaloop.swf?clip_id=81368903</a></li>
  </ul>
  
  <p>I need to parse the above URL to get two group as folloes:</p>
  
  <pre><code>Group1                 Group 2
  vimeo.com/             99612902
  www.vimeo.com/         99612902
  http://vimeo.com/      99612902
  http://www.vimeo.com/  99612902
  http://vimeo.com/      81368903
  </code></pre>
  
  <p>I've tried the followin regex</p>
  
  <pre><code>^((http[s]?|ftp):\/)?\/?([^:\/\s]+)(:([^\/]*))?((\/[\w\-]+)*\/)([\w\-\.]+[^#?\s]+)(\?([^#]*))?(#(.*))?
  </code></pre>
  
  <p>but which yields me unwanted and empty group. Please help me out.</p>