3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $src = 'https://www.youtube.com/embed/lYbNbJG3-1k#'; preg_match('#(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})#i',$src,$output); var_dump($output);
based on GDFX1
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> string(29) "youtube.com/embed/lYbNbJG3-1k" [1]=> string(11) "lYbNbJG3-1k" }