In java, I'm trying to process functions of the from FUNC{parameter,parameter} using regular
expressions.
I've isolated the string containing the parameters, and now I have to extract them from the string. My idea was to split the parameters using the string.split method and the , symbol. I.e. expression.split(",").
The problem is that the parameters can themselves be functions, i.e. something like
FUNC1{FUNC2{1,2},7}
So splitting just by , doesn't work. What I'm trying now is the follow regex:
[^\\{]+,[^\\}]+
Which I think means, split the parameters by a , that is preceded by something that isn't a { and followed by something that isn't a }. But this isn't working either...what could be the problem?
FUNC1{FUNC2{FUNC3{FUNC4{...}}}}arbitrarily deep?