3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <li class="item" xx-href-xx="http://xx.xx/s/randomtext/randomtext?NOTradnomtext" yy-href-gg="http://xx.xx/X/RANDOMTEXTWHATIWANT/STILLRADNOMTEXTWHATIWANT?NOTradnomtext" data="212123134" data-title="TITLE"> <a class="front" href="#" xx-href="http://xx.xx/s/randomtext/randomtext?NOTradnomtext"> <img src="http://photo.jpg" alt=""> <div class="cock"> <div class="action"></div> </div> </a> <div class="label"> <div> <h3 class="title">Example</h3> <p>2013-10-25 : 03:35</p> </div> </div> </li> HTML; preg_match_all( '# [a-z]{2}-href-[a-z]{2}="https?://[^/"?]+/[^/"?]+/\K[^/"?]+/[^/"?]+#i', $html, $matches ); var_export($matches[0]);

preferences:
33.98 ms | 405 KiB | 5 Q