import res = "\":{},[test1, test2]"print( re.sub(r'(\[[^][]*])|[{}",]', r'\1', s) )
Standard input is empty
:[test1, test2]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!