Youtube Video Link Regular Expression

A regular expression that matches all valid Youtube Video Links (short links are supported as well).

/http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?=]*)?

Youtube Video Link Example:

  • http://www.youtube.com/watch?v=BeG_UU-Bf5k
  • https://www.youtube.com/watch?v=BeG_UU-Bf5k
  • http://youtu.be/BeG_UU-Bf5k

See Also:

Regex Is Copied!