With the help of recursion clause (https://www.regular-expressions.info/recurse.html),
(\w*|\w*::\w*)\((?:\s*((?<=\()|(?<!\(),)\s*((?R)|\$\w+)\s*)*\)
This expression matches function calls like below:
Registry::initRegistry(registry( $a, $b, abc( $a, $b, $c), $d));