+1  A: 

HtmlAgilityPack....

Next time - search for an answer before. This is duplicate for sure.

Little tutorial.

Arnis L.
+4  A: 

You just asked an almost identical question and deleted it. Here was the answer I gave before:


Try the HTML Agility Pack.

Here's an example:

 HtmlDocument doc = new HtmlDocument();
 doc.Load("file.htm");
 foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
 {
    HtmlAttribute att = link["href"];
    att.Value = FixLink(att);
 }
 doc.Save("file.htm");

Regarding your extra question regarding regex: do not use Regex to parse HTML. It is not a robust solution. The above library can do a much better job.

Mark Byers
But this code gives error...
Harikrishna
The function `FixLink` is not defined, so this won't compile. It is just an example of what the code might look like - you can't just copy and paste it into your project. Also, you haven't told us what exactly you need to do, so it's very unlikely that this code snippet will be exactly what you need.
Mark Byers