Input file (test): Desired output: What I have done: Question: How do you print the regex groups in sed (multiline)? Answer If you use sed like this: then it will print in different lines: But is this what you are trying to print? Or you want to print text in hrefs? Update 1: To get hrefs between well formed <a
Tag: multiline
How to do multiline search and replace with a script?
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