3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Peter (1) (143) Peter (2) (144) Daniel (12) "; preg_match_all("/[\d()]+$/m", $str, $match); print_r(preg_replace("/[()]/", "", $match[0]));

preferences:
50.22 ms | 402 KiB | 5 Q