3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $re = '/(alt)=("[^"]*")/'; $str = '<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 item">\n <div class="portfolio-item">\n <a href="http://www.example.com/en/test/1234/11224/Music 09" title="Music Club ( sun ) Music 09" class="portfolio-item-link" >\n <span class="portfolio-item-hover"></span>\n <span class="fullscreen"><i class="icon-play"></i></span>\n <img src="http://www.example.com/teststorage/episodes/11224/201.jpg" alt="Music Club ( sun ) Music 09" />\n </a>\n <div class="portfolio-item-title">\n <a href="http://www.example.com/en/test/1234/11224/Music 09" title="Music Club ( sun ) Music 09" class="portfolio-item-link"><h4>Music 09</h4></a>\n </div>\n <div class="clearfix"></div>\n </div>\n </div>'; preg_match_all($re, $str, $matches); print_r($matches);
Output for 4.3.0 - 7.2.0
Array ( [0] => Array ( [0] => alt="Music Club ( sun ) Music 09" ) [1] => Array ( [0] => alt ) [2] => Array ( [0] => "Music Club ( sun ) Music 09" ) )