1
    <table> 
<tr> 
<td style="width:180px"> 
<a href="/search?q=user:240698+[java]" class="post-tag" title="show all posts by this user in 'java'">java</a><span class="item-multiplier">&times;&nbsp;176</span><br> 
<a href="/search?q=user:240698+[servlets]" class="post-tag" title="show all posts by this user in 'servlets'">servlets</a><span class="item-multiplier">&times;&nbsp;25</span><br> 
<a href="/search?q=user:240698+[jsp]" class="post-tag" title="show all posts by this user in 'jsp'">jsp</a><span class="item-multiplier">&times;&nbsp;11</span><br> 
<a href="/search?q=user:240698+[core]" class="post-tag" title="show all posts by this user in 'core'">core</a><span class="item-multiplier">&times;&nbsp;9</span><br> 
</tr>
</table>

from the above code I need to fetch only java, servlets, jsp and core.

Can anybody plz help me out to write a regex in java to fetch those?

Thanks

giri
  • 26,773
  • 63
  • 143
  • 176

2 Answers2

2

Please don't use regex to parse HTML, use HTML parsers instead.

Community
  • 1
  • 1
YOU
  • 120,166
  • 34
  • 186
  • 219
1

If I'd have to use Regex, I'd try

"/search\?q=user:\d+\+\[(\w*)\]" 
Jens
  • 25,229
  • 9
  • 75
  • 117