I'm trying to parse nested parenthesis using regex. It works fine with R option, but only if there is nothing before those parenthesis. In my case I need: "digit (in1a (in2) in1b)"
This code (I took nesting sample from manual) does not work:
-------------BEGIN CODE
preg_match_all("% \d \s (( ( (?>[()]+) | (?R) ) ))" \s %Sxms",
"6 (in1a (in2) in1b)",
$out, PREG_SET_ORDER);
print_r($out);
----------END CODE
PLEASE HELP !