My code needs to clean up the whitespace around brackets of any kind, so I assume using regex is my best course of action. My strings will (I think) always look like the following (although more robustness is always appreciated):
text = "the people ( that don't still like / love you } are going to ..."
to look like:
final = "the people (that don't still like / love you} are going to ..."
My current attempt seems to do nothing (I know it only considers round brackets for now):
final = re.sub( r'\s[\(]+\s(\w*)\s[\)]+\s' , '\s[\(]+\1[\)]+\s' , text )
Please & thank you.