I am trying to extract http://xyz.com/5
link from the string below. You can see that only for that one we have the class="next"
attribute. So I am trying to get that based on this attribute.
<a href='http://xyz.com/1' class='page larger'>2</a>
<a href='http://xyz.com/2' class='page larger'>3</a>
<a href='http://xyz.com/3' class='page larger'>4</a>
<a href='http://xyz.com/4' class='page larger'>5</a>
<a href='http://xyz.com/5' class="next">»</a>
I tried below pattern but this returns all links in the entire text.
<a href='(.+?)' class="next">
(I understand from this site that using regular expressions to parse HTML is a bad idea, but I have to do this for now.)