Reputation: 13
"Func(1,2),Func(Sub(1,Func(true)),2),Func(Sub(1,false),3)"
[1] = "Func(1,2)"
[2] = "Func(Sub(1,Func(true)),2)"
[3] = "Func(Sub(1,false),3)"
I Have this string. And I have to use pcre-regex to seperate this into X parts. The parts should be splitted at the comma. What gives me the most trouble is the fact that these function-strings could also contain further sub-function-strings. So I guess it's only possible to identify the split-position by counting parantheses.
/.*(?=\().*(?=\)\,)/gU
All my attempts to solve this problem didn't work.
Upvotes: 1
Views: 61