<IMG onload=\ "if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=点击查看大图; this.title=点击查看大图;}\ "
src= \"http://images18.567.com/1002/1192961814_0.36420200.jpg \" border=0 name=mms_img>
<IMG src= \"http://images18.567.com/1402/1192961814_0.36420333.jpg \" border=0>如何取img标签中src=""的内容,正则如何写
本人认为首先应该匹配<IMG ... src=""> 然后再从中取出src=""的内容.
哪位大侠指教一下
src= \"http://images18.567.com/1002/1192961814_0.36420200.jpg \" border=0 name=mms_img>
<IMG src= \"http://images18.567.com/1402/1192961814_0.36420333.jpg \" border=0>如何取img标签中src=""的内容,正则如何写
本人认为首先应该匹配<IMG ... src=""> 然后再从中取出src=""的内容.
哪位大侠指教一下
解决方案 »
- VS2008 如何在编译环境下允许编辑
- C# 中怎么通过代码画出立方体?
- 关于Dsoframer的open方法打开文件的权限问题
- 关于Response的问题
- VS2005如何连接SYBASE数据库?最好有实例
- 100分请教高手:关于一键登录多QQ程序的开发方法
- 转换为string型的问题
- datagridview1中ComboBox数据源更新
- 向panel加入窗体的时候,文本框里的文字不能选中
- 各位老大请帮忙,我急需一份Csharp的收邮件的程序
- 帮帮忙...大哥们..谁能介绍本好的ASP.NET的书..最好有下载地址..帮帮忙..
- 2007-11-15 8:00:00 转换成2007-11-15 08:00:00
string s = textBox1.Text;
foreach (Match vMatch in Regex.Matches(s,
@"<img[^>]*\s*src\s*=\s*""(?<src>[^>^""]*)""[^>]*>", RegexOptions.IgnoreCase))
{
Console.WriteLine(vMatch.Result("${src}"));
}
输入内容
<IMG onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=点击查看大图; this.title=点击查看大图;}"
src="http://images18.567.com/1002/1192961814_0.36420200.jpg" border=0 name=mms_img>
<IMG src="http://images18.567.com/1402/1192961814_0.36420333.jpg" border=0> 输出结果
[code=BatchFile]http://images18.567.com/1002/1192961814_0.36420200.jpg
http://images18.567.com/1402/1192961814_0.36420333.jpg[/code]
此题不接分.只为学习LS的敬业精神
照应楼主的内容写了一个..,
希望楼主尽早接贴..string s =内容 ;
foreach (Match vMatch in Regex.Matches(s,
@"<IMG\s+.*?\s+src=\s+\\\s+"(?<src>.*?)\s.*?>", RegexOptions.IgnoreCase))
{
Console.WriteLine(vMatch.Result("${src}"));
}