I wrote this task as below: s='hey (come) go' re.sub('[\(].*?[\)]', '', s) The output is: 'hey go' But if s='hey (come) go (flat)' then the 'go' is deleted too. How can I write code that output should be 'hey go'