1

Possible Duplicate:
Best methods to parse HTML

Hi, I want to have regex that match only anchor tag which contains text. And in group i want link without domain Eg. I want to match something like that:

<a href="https://stackoverflow.com/questions/ask/users/login" id="login-link">log in</a>
group1:questions/ask/users/login

but it can't match :

<a href="https://stackoverflow.com/questions/ask/users/login" id="login-link"><img src="https://stackoverflow.com/images/login.png" alt="log in" title="login" /></a>

I have created something like that:

<a.*?href=["']http:\/\/.*?\/(.*?)["'].*?>(.*?)</a>

And it works quite good but it match all anchor tags.

Community
  • 1
  • 1
kierzniak
  • 41
  • 1
  • 3

0 Answers0