string yourStr = textBox1.Test;
Match m = Regex.Match(yourStr, @"<img[^>]*src=""(\S{4,50})""(.*?)>", RegexOptions.IgnoreCase);
if (m.Success)
{
string resultStr = m.Groups[1].Value;
}不过觉得楼主的正则最好还是改成这样的
string yourStr = textBox1.Test;
Match m = Regex.Match(yourStr, @"<img[^>]*?src=""([^""]*?)""([^>]*?)>", RegexOptions.IgnoreCase);
if (m.Success)
{
string resultStr = m.Groups[1].Value;
}
Match m = Regex.Match(yourStr, @"<img[^>]*src=""(\S{4,50})""(.*?)>", RegexOptions.IgnoreCase);
if (m.Success)
{
string resultStr = m.Groups[1].Value;
}不过觉得楼主的正则最好还是改成这样的
string yourStr = textBox1.Test;
Match m = Regex.Match(yourStr, @"<img[^>]*?src=""([^""]*?)""([^>]*?)>", RegexOptions.IgnoreCase);
if (m.Success)
{
string resultStr = m.Groups[1].Value;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货