string yourhtml = @"<img alt= ""test"" alt=network-adaptors.jpg src= ""/IT/cr/2007/0704/3441139462.jpg "" style= ""border:0px solid #000; "" _extended= ""true ""> <img alt= ""test"" alt=network-adaptors.jpg src= ""/IT/cr/2008/34/3656462.jpg "" style= ""border:0px solid #000; "" _extended= ""true ""> "; string str = "http://www.baidu.com/"; yourhtml = Regex.Replace(yourhtml, @"(?i)(?<=<img[^>]*?src=s*(['""]))(.*/)+(?=[^'""/]+1)", "http://www.baidu.com/$2", RegexOptions.IgnoreCase);