I am trying to extract URL from an tag, however, instead of getting https://website.com/-id1, I am getting tag link text. Here is my code:
string text="<a style=\"font - weight: bold; \" href=\"https://website.com/-id1\">MyLink</a>";
string parsed = Regex.Replace(text, " <[^>] + href =\"([^\"]+)\"[^>]*>", "$1 " );
parsed = Regex.Replace(parsed, "<[^>]+>", "");
Console.WriteLine(parsed);
The result I got was MyLink which is not what I want. I want something like
https://website.com/-id1
Any help or a link will be highly appreciated.