I am having following set of image map tags;
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
I need to extract href attribute and replace it with another url
I am using following code but does not seems to work;
string input = @"<area shape=""rect"" href=""http://www.google.com"">";
string pattern = "(href=([^ ]+))";
Regex rgx = new Regex(pattern);
string result2 = rgx.Replace(input, m => m.Groups[1].Value.Replace(result,"test.com"));
Could someone please help me.
Thanks