62,267
社区成员
发帖
与我相关
我的任务
分享
MatchCollection mc = Regex.Matches(this.TextBox1.Text, @"<img.*?src=""(- *
- [^:]*)""*>", RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
Response.Write(m.Value + "<br/>");
}
Response.End();
"(?<=<img[^>]*?src=)([""']?)[^>""':\s]+\1(?=[\s\b>])"
//测一下
Regex.Replace(input,@"(?i)(?<=<img\b.*?)src=.*?:[^""'\s>]+[""']?","");
Regex.Replace(input,@"(?i)(?<=<img\b.*?)src=.*?:[^"'\s>]+["']?","");
(?<=img.*?src=")[^:]+?(?=".*?[\r\n])|(?<=img.*?src=)(/[^:]*?)(?=/>)
(?<=img.*?src=")([^:]*?)(?=".*?[\r\n])|(?<=img.*?src=)(/[^:]*?)(?=/>)
MatchCollection mc = Regex.Matches(this.TextBox1.Text, @"<img.*?src=""(- *
- [^:]*)""*>", RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
if (m.Success)
{
Response.Write(m.Value + "<br/>");
}
}
Response.End();
(?<=img.*?src=")[\w\W][^:]*?(?=".*?[\r\n])|(?<=img.*?src=)/[\w\W][^:]*?(?=/>)
<img.*?src=(?<src>[^:]*?|"[^:]*?"|'[^:]*?')/{0,1}><img.*?src="[^:]*">
<img width="100" height="200" alt="" src="/img1.gif" />
<img width="100" height="200" alt="" src="/img1.gif">
<img width="100" height="200" alt="" src="c:\img1.gif">
<img width="100" height="200" alt="" src="c:\img1.gif" />
<img width="100" height="200" alt="" src="f:\img1.gif">
<img width="100" height="200" alt="" src="http://www.g.cn/img1.gif" />
<img width="100" height="200" alt="" src="http://www.g.cn/img1.gif">
<img width="100" height="200" alt="" src="img1.aspx?id=img1" />
<img width="100" height="200" alt="" src="img1.aspx?id=img1">
<img width="100" height="200" alt="" src=/img1.gif />