I have this string in Python:
s = "foo(a) foo(something), foo(stuff)\n foo(1)"
I want to replace every foo instance with its content:
s = "a something, stuff\n 1"
The string s is not constant and the foo content changes every time. I did something using regex, split and regex, but got a very large function. How can I do it in a simple and concise way? Thks in advance.