3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_content = '<iframe frameborder="0" width="480" height="270" src="//www.dailymotion.com/embed/video/x248ctr_this_is_cool" allowfullscreen></iframe><br /><a href="http://www.dailymotion.com/video/x248ctr_logitech-g402-hyperion-fury-gaming-mouse-inhumanly-fast_tech" target="_blank">Logitech G402 Hyperion Fury Gaming Mouse...</a> <i>by <a href="http://www.dailymotion.com/LinusTechTips" target="_blank">LinusTechTips</a></i>'; preg_match('#dailymotion.com\/(?:embed\/video|swf\/video|video)\/([^\'"\/\?_]+)#i',$_content, $matches); var_dump($matches); echo $_content;
based on XC1bD
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(35) "dailymotion.com/embed/video/x248ctr" [1]=> string(7) "x248ctr" } <iframe frameborder="0" width="480" height="270" src="//www.dailymotion.com/embed/video/x248ctr_this_is_cool" allowfullscreen></iframe><br /><a href="http://www.dailymotion.com/video/x248ctr_logitech-g402-hyperion-fury-gaming-mouse-inhumanly-fast_tech" target="_blank">Logitech G402 Hyperion Fury Gaming Mouse...</a> <i>by <a href="http://www.dailymotion.com/LinusTechTips" target="_blank">LinusTechTips</a></i>