Could anyone be able to give a regular expressiont to match the link text between <a> and </a>
tags in a HTML snippet.
Sample data: <a href="link.html">Link Title</a> - 15 comments <br/> <a href="otherlink.html">Some other Title</a> - 6 comments
Requirement: I need to extract only the link texts (i.e. the one between <a> and </a>
- Link Title and Some other Title) to use in my application.
Please note that the link text might contain non-english characters and all possible puncutations also. I tried using '.' operator, but since it does a greedy match, it matches the entire text between first <a>
and last </a>
. But I want only the link texts.
Any help?