3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '(ab(cd)ef))'; preg_match_all('@\( ( ( (?>[^()]+) | (?R) )+ ) \)@x', $string, $matches); mb_ereg('\([^()]+\)', $string, $regs); var_dump($matches, $regs);

preferences:
105.65 ms | 402 KiB | 5 Q