3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '[this is block this is also same "block" this is same block another same block] new block! another new block! [this is new block this is also a new block]'; var_export(preg_match_all('~\[[^\]]*]|.+~', $text, $matches) ? $matches[0] : 'nothing');

preferences:
17.37 ms | 402 KiB | 5 Q