import re result = re.sub(r"vasya", "", "Vasya foo vasya bar VASYA", 0, re.IGNORECASE)if result: print (result)
Standard input is empty
foo bar
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!