Revision: 26411
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 27, 2010 16:02 by nkm
Initial Code
/http:\/\/(?:youtu\.be\/|(?:[a-z]{2,3}\.)?youtube\.com\/watch(?:\?|#\!)v=)([\w-]{11}).*/gi
Initial URL
Initial Description
PCRE that matches any kind of YouTube URL and catches its video ID. It supports three kinds of URL: the classic (?v=), the AJAXed one (#!v=) and the short version (youtu.be). It also supports international URLs. Tested with Javascript and PHP.
Initial Title
YouTube URL matcher, video ID catcher
Initial Tags
url, javascript, php, video, regexp
Initial Language
Regular Expression