I have this regex:
(?=<a .*href=")(.+)(?=".*>My Text<\/a>)
With this, I try to extract href
value from an specific HTML tag <a>
from an HTML
.
Let's say I have this HTML
:
<html>
<head>
...
</head>
<body>
...
<a class="..." href="..." ..="..">My Text</a>
...
</body>
</html>
With my regex I get <a class="..." href="..." ..="..
(stop before ">
), but I want only href
value.
Edit: this answer: regular expression for finding 'href' value of a <a> link don't help me. With that regex I get all tags <a>
with all attributes of tag.