I’m trying to replace every multiline import inside a Python source file.. So, the source goes like and I’d like to get something like I tried to use sed but it looks like it doesn’t support non-greedy matching of the closing parenthesis, so it “eats” the second import.. 🙁 Any hint? Is this impossible with sed? Should I try with