3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '`(?<=\()\w+(?:[,\h]+\w+)*(?=\))`'; $str = 'Citrus fruits (oranges, mandarins lemons) have many nutrients'; preg_match($re, $str, $matches); print_r(preg_split("~[,\h+]~", $matches[0], -1, PREG_SPLIT_NO_EMPTY));

preferences:
26.76 ms | 406 KiB | 5 Q