human
How can I remove text within parentheses with a regex?
assistant
Here is some code to remove parentheses and text within it in string `filename`

re.sub('\\([^)]*\\)', '', filename)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.