Something like this? >>> p=r"([^()]*)" >>> re.sub(p," ","Hello (this is extra) world (more text)") 'Hello world '