@心悠魂然: 行不通,不知道是不是我写的有问题,读的地址本身就放在了 MatchCollection 中,如果能单独的提取出图片的 http://www.baidu.com/ 这部分,保留文件名就很好解决,
test
======================================
string html = richTextBox1.Text; //源码
string temp = "";
string rule = "(?<=">
//string rule = "(?<=
Regex reg = new Regex(rule);
MatchCollection coll = reg.Matches(richTextBox1.Text); //得到匹配
foreach (Match item in coll)
{
string code = item.Value; //初始地址
temp = item.Value;
temp = code.Substring(code.LastIndexOf("/")).Replace("/", string.Empty); //分割文件名
string path = "www.baidu.com/images/";
string imgurl = path + temp;
richTextBox2.Text = Regex.Replace(html,rule,path+temp);//替换
}
====================