I have an example string:
string myString = "value,value,(value,(value, value, value, (value), value),value)";
The goal is to iterate through it and deserialize it into a hierarchy of class objects.
The reason why most other examples asking a similar question on here will not work is due to the recursion, looking ahead (or back) for even number of parentheses will not work.
I have considered storing it as JSON, but the object types of value will vary without notice and that has proved to confused even json.net in the past especially since the types will likely all be related by inheritance.
So, given the example string, the goal is to split on comma ",", but ignore everything in parentheses until my recursion loop digs into that sub set then uses the same regex to split its contents.
I have no code yet as I am still brainstorming this method.
Also note that the sub lists may not necessarily be the last element in the parent list as demonstrated by a couple lingering value
's in my example at the end.
Please do not mark as duplicate without fully reading the question and understanding why it is NOT the same as questions like this