3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "[test1](test2) testing the regex [test3](test4)"; preg_match_all("/(\[.+?\])(\(.+?\))/i", $s, $m); var_dump($m[1]); var_dump($m[2]);

preferences:
25.56 ms | 405 KiB | 5 Q