import reres = re.sub(r"(?i)(?<=\W)the(?!\w)", "zzz", "The Thing To (The) Theme of Athens, The Goethe")print(res)
Standard input is empty
The Thing To (zzz) Theme of Athens, zzz Goethe
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!