-2

Possible Duplicate:
How to use regular expressions to parse HTML in Java?

From the following code, I want to extract HREF based on span item. Suppose I give input as "Home", then I should be able to get the href before it. What is the regular expression for the same in Java

This is the HTML code

<a class="first navibar_link" href="/mnetbank/servlet/Main?prefix=0003015106-680870747659702266"><span>Home</span></a> 
Community
  • 1
  • 1
EnthuDeveloper
  • 672
  • 9
  • 25

1 Answers1

1

Don't use regular expressions for extracting data from HTML, it's too complicated to get it right. Use Jsoup instead.

Roland Illig
  • 40,703
  • 10
  • 88
  • 121