3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = "text text text text [helloo] text [hello2] (hello3) text"; $pattern = '/\[([^\)]*)\]/'; preg_match_all($pattern, $subject, $matches); print_r($matches);

preferences:
48.72 ms | 402 KiB | 5 Q