<?php $pattern="\( ( (?>[^()]+) | (?R) )* \)"; $str="(def a (x) (+ 1 x))(print (a 1))"; var_dump(preg_grep(pattern,str));
You have javascript disabled. You will not be able to edit any code.