3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fullString = 'ignore everything except this (text) and (that (text here))'; if (preg_match_all('~\(([^()]*)\)~', $fullString, $matches)) { print_r($matches[0]); // Get whole match values print_r($matches[1]); // Get Group 1 values }

preferences:
46.13 ms | 402 KiB | 5 Q