java - Regular expression to match text between <a ..> and </a> -
could able give regular expressiont match link text between <a> , </a>
tags in 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: need extract link texts (i.e. 1 between <a> , </a>
- link title , some other title) use in application.
please note link text might contain non-english characters , possible puncutations also. tried using '.' operator, since greedy match, matches entire text between first <a>
, last </a>
. want link texts.
any help?
try
<a[^>]+>(.*?)</a>
Comments
Post a Comment