3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $subject = <<<HTML <div class="tabs_container"> <ul class="tabs"> ##BEGINLOOP##gAs## <li><a href="#">##title##</a></li> ##ENDLOOP## </ul> ##BEGINLOOP##LI## <div class="tabs_content">##title## is ##content##</div> ##ENDLOOP## </div> HTML; preg_match_all('/(?:##BEGINLOOP##)([a-zA-Z]*)##(.+?)(?:##ENDLOOP##)/s', $subject, $matches); var_dump($matches);
Output for 4.3.0 - 7.1.0
array(3) { [0]=> array(2) { [0]=> string(77) "##BEGINLOOP##gAs## <li><a href="#">##title##</a></li> ##ENDLOOP##" [1]=> string(94) "##BEGINLOOP##LI## <div class="tabs_content">##title## is ##content##</div> ##ENDLOOP##" } [1]=> array(2) { [0]=> string(3) "gAs" [1]=> string(2) "LI" } [2]=> array(2) { [0]=> string(48) " <li><a href="#">##title##</a></li> " [1]=> string(66) " <div class="tabs_content">##title## is ##content##</div> " } }