fork download
  1. import re
  2. str = "F(foo)"
  3. print(re.sub(r"F\((\w+)\)", r"F('\1')", str))
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
F('foo')