import re #original stringtext = "The dog walked (ABC in the park"text = re.sub(r'(\([A-Z]+(?!\))\b)', r"\1)", text)print(text)
Standard input is empty
The dog walked (ABC) in the park
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!