From the html source I've to identify anchor tag which shouldn't be nested.
For example:
<a href="http://www.abc.com">abc<a href="http://www.dbc.com">dbc</a>
From this on first match it should return
<a href="http://www.abc.com">abc
On subsequent find
<a href="http://www.dbc.com>dbc</a>
While finding it should return from open anchor tag to close anchor tag if it is not nested. If it is nested it should return string from open anchor tag to before the beginning of the nested open anchor tag.
Please help. Thanks in advance