I want to append some text (.html) at the end of line in format [some_text](some/other/text); basically links in markdown syntax.
Example
[Test](test/link) would be [Test](test/link.html)
[Test](test/link1/link) would be [Test](test/link1/link.html)
[Test] would be [Test]
(test) would be (test)
So I was trying out unix sed with syntax: sed -i 's/\[*\](*)/.html)/g' filename.md. The said sed syntax is wrong and not working, can someone help? I'm open to using other tools like awk or perl, it is appropriate for this scenario.
Solution: sed -i 's/\(\[[^][]*]([^()]*\))/\1.html)/g' filename.md
Suggested by @WiktorStribiżew