I am trying to combine all the elements in a list on the basis of some delimiters; I am facing difficulty when the delimiter pair is more than 1.
Say this is the list :
['{','k0c','k1b','k2b','k3b','}','{','\\g0','\\g1','\\g2','\\g3','}']
12 items in this list
Whenever it finds '{' and '}' I want all of the elements within those indexes to be concatenated into one so that it is:
['{ k0c, k1b, k2b, k3b }' , '{\\g0 , \\g1, \\g2, \\g3 }' ]
2 items in this list are what I want with all the elements inside the delimiters turned into one element of the list.