I have a nested comma string such as
[1,2,[],[a,b],[ab,bc,cd],[1,2,[3,4],[5,6],7]]
I want to split the string with commas only upto 1st level. The output I am expecting is
1
2
[]
[a,b]
[ab,bc,cd]
[1,2,[3,4],[5,6],7]
I tried splitting string in Java using regexp but couldn't get the correct output. How could we achieve this?
Though this question Java: splitting a comma-separated string but ignoring commas in quotes
is helpful but I have separate start and end nesting tag([,]), so I couldn't directly use that solution