title: how to get youtube video id from url
body: <p>I am trying to check whether a url is a valid youtube video URL and get the youtube video ID from it, so far I am using a simple javascript split function in order to achieve this, however this has some minor disadvantages as youtube has multiple URL's.</p>
  <p>I have been viewing other stackoverflow threads however all of them only support 1 specific URL which is not what I need.</p>
  <p>I need something that matches all these URL's:</p>
  <blockquote>
  <p>http(s)://www.youtu.be/videoID</p>
  <p>http(s)://www.youtube.com/watch?v=videoID</p>
  </blockquote>
  <p>(and optionally any other short URL's which the script automatically detects whether it contains a youtube video)</p>
  <p>Any ideas which can be handled by the browser quick/efficient is greatly appreciated!</p>