How to split string by outer parentheses ignoring nested parentheses - Python

后端 未结 0 675
鱼传尺愫
鱼传尺愫 2021-01-28 04:25

I want to split a string by the outer parentheses ignoring all nested parentheses.

E.g: sentence = "I am going (to the (supermarket)) but I (forgot) my wallet"<

相关标签:
回答
  • 消灭零回复
提交回复
热议问题