帮写个正则,获取<img>里面的src
我这个img标签不仅仅是
<img src=""/>
<img src="" style="" class="" style="width:353px;height:249px;" alt="帮写个正则,获取<img>里边的src"/>
Regex reg1 = new Regex(@"(?i)<img[^>]*?src=(['""]?)(?<src>[^'""\s>]+)\1[^>]*>", RegexOptions.IgnoreCase
[解决办法]
RegexOptions.Singleline);
MatchCollection mc = reg1.Matches(page);
foreach (Match m1 in mc)
{
string imgUrl = m1.Groups["src"].Value;
}