How can I remove text within parentheses with a regex? January 3, 2023 by Tarik s/\([^)]*\)// So in Python, you’d do: re.sub(r'\([^)]*\)', '', filename)