title: Youtube I.D parsing for new URL formats
body: <p>This question has been asked before and I found this:</p>
  
  <p><a href="https://stackoverflow.com/questions/2220764/reg-exp-for-youtube-link">Reg exp for youtube link</a></p>
  
  <p>but I'm looking for something slightly different. </p>
  
  <p>I need to match the Youtube I.D itself compatible with all the possible youtube link formats. Not exclusively beginning with youtube.com.</p>
  
  <p>For example:</p>
  
  <p><code>http://www.youtube.com/watch?v=-wtIMTCHWuI</code></p>
  
  <p><code>http://www.youtube.com/v/-wtIMTCHWuI?version=3&amp;autohide=1</code></p>
  
  <p><code>http://youtu.be/-wtIMTCHWuI</code></p>
  
  <p><code>http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3D-wtIMTCHWuI&amp;format=json</code></p>
  
  <p><code>http://s.ytimg.com/yt/favicon-wtIMTCHWuI.ico</code></p>
  
  <p><code>http://i2.ytimg.com/vi/-wtIMTCHWuI/hqdefault.jpg</code></p>
  
  <p>is there a clever strategy I can use to match the video I.D <code>-wtIMTCHWuI</code> compatible with all these formats. I'm thinking character counting and matching <code>=</code> <code>?</code> <code>/</code> <code>.</code> <code>&amp;</code> characters.</p>