I am currently trying to learn Linux commands and regular expressions, I am stuck on a little problem that I have trying to find a series of links within a file using sed and regular expressions, can anyone help me work this out and where I am going wrong. The links are something like this
<a href="../a-lot-of-different/words-that/should-link.html">Useful links</a>
<a href="..//a-lot-of-different/words-that/should-find-lots-of-links.html">Multiple links</a>
<a href="../another-word-and-links/multiple-words/sjshfi-dfg.html">more links</a>
This is what I have.
sed -n '/<a*href=”^[../"]*\([a-z]*\)^[.html](["]*\)/p' /file > newfile