Reputation: 1175
I tried this but it doesn't work
return re.sub('([^)]*)','', myResultStats.text)
suggestions?
thanks
Upvotes: 3
Views: 7924
Reputation: 2439
You need to escape the brackets
return re.sub('\([^)]*\)','', myResultStats.text)
Upvotes: 2
Reputation: 298532
Try this:
return re.sub('\(.*?\)','', myResultStats.text)
Parentheses denote capture groups, so you have to escape them.
Upvotes: 9