Skip to content

Instantly share code, notes, and snippets.

View tehknox's full-sized avatar

Frédérick Lebel tehknox

  • Let's Code
  • Montréal, Canada
View GitHub Profile
<?php
/**
* YouTube Preg Match Test Case.
*
* @author Mario "Kuroir" Ricalde
*/
// Regular Expression (the magic).
$youtube_regexp = "/^http:\/\/(?:www\.)?(?:youtube.com|youtu.be)\/(?:watch\?(?=.*v=([\w\-]+))(?:\S+)?|([\w\-]+))$/";