Split text based on depth 'level' of parentheses



There is a list with text items.
I would like to subdivide the text into fragments, based on the parentheses ‘depth’.

{0} = text parts ‘outside’ parentheses
{1} = text part ‘inside’ first level of parentheses
{2} = text part ‘inside’ second level of parentheses
{3} = etc.

any suggestions?

2021-04-09 level of parentheses.gh (6.4 KB)


Thanks :slight_smile:

I have no idea how to do it with native components … but with code this is elementary. Like:

Notify if you want a full indicative demo (C#).

Try this geometrical approach. Vanila GH.
Might look complicated but it is working…

2021-04-09 level of parentheses_RE.gh (21.8 KB)