Input file (test):
123456<a id="id1" name="name1" href="link1">This is link1</a>789<a id="id2"
href="link2">This is link2</a>0123
Desired output:
link1
link2
What I have done:
$ sed -e '/<a/{:begin;/<\/a>/!{N;b begin};s/<a\([^<]*\)<\/a>/QQ/;/<a/b begin}' test
123456QQ789QQ0123
Question: How do you print the regex groups in sed (multiline)?