import res='{[a] abc (b(c)d)}'rx = re.compile(r'\([^()]*\)|\[[^][]*]|[{}]')while rx.search(s): s = rx.sub('', s)print(s.strip())
Standard input is empty
abc
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!