62,243
社区成员




string outhost = "www.myname.com";
Regex reg = new Regex(@"(?is)(?<=<img\s+src=(['""]?))(?!http://)(?=[^'""\s>]+\1)");
string result = reg.Replace(yourStr, "http://" + outhost + "/");
string test = "<IMG src=\"upload/2009_11/09112110144808.jpg\" border=0>";
string outhost = "www.myname.com";
Regex reg = new Regex(@"(?is)(?<=<img\s+src=(['""]?))(?!http://)(?=[^'""\s>]+\1)");
string result = reg.Replace(test, "http://" + outhost + "/");
/*----------输出------------
<IMG src="http://www.myname.com/upload/2009_11/09112110144808.jpg" border=0>
*/