YouTube URL matcher, video ID catcher

/ Published in: Regular Expression
Save to your folder(s)

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 ( It also supports international URLs.

Tested with Javascript and PHP.

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.