Thanks, I'm not sure how this would help me. The problem I had was how to parse nested parentesis. There is a smaple in Manual, but the problem is it does not work if there is another pattern before it:
$variation="(( ( (?>[()]+) | (?R) )* ))";
preg_match_all("%
\d \s
$variation \s*
(?{print "Hello"})
%Sxms",
"6 (in1a (in2) in1b)",
$out, PREG_SET_ORDER);
print_r($out);