CSDN博客

img winform

html中找出图片标签的正则表达式

发表于2004/10/5 11:09:00  761人阅读

using System.Text.RegularExpressions;

string s = ".................";

 Regex re = new Regex(@"<img[^>]+src=(?:""(?<src>[^""]+)""|'(?<src>[^']+)'|(?<src>/S+))[^>]*>", RegexOptions.IgnoreCase);
 MatchCollection mc = re.Matches(s);
 Console.WriteLine(mc.Count);
 foreach(Match m in mc)
  Console.WriteLine("{0} --> {1}", m.Value, m.Groups["src"].Value);

阅读全文
0 0

相关文章推荐

img
取 消
img