import restr = "F(foo)"print(re.sub(r"F\((\w+)\)", r"F('\1')", str))
Standard input is empty
F('foo')
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!