I want to split a string separated by commas not inside Matrix expression. For example:
input:
value = 'MA[1,2],MA[1,3],der(x),x,y'
expected output:
['MA[1,2]','MA[1,3]','der(x)','x','y']
I tried with value.split(','), but it splits inside [], I tried with some regular expressions to catch extract text inside [] using this regular expression
import re
re.split(r'\[(.*?)\]', value)
I am not good in regular expression,Any suggestions would be helpful