- string htmlimg = FCKeditor1.Value;
- MatchCollection mc = Regex.Matches(htmlimg, @"<img.*?src/s*=[/s""']*(?<url>[^/s""']*)[^>]*>", RegexOptions.IgnoreCase);
- string[] imgUrls = new string[mc.Count];
- int i = 0;
- foreach (Match m in mc)
- {
- imgUrls[i++] = m.Groups["url"].Value;
- }
- Response.Write(string.Join(",", imgUrls));
//效果:/UserFiles/Image/DSCN0957.JPG,/UserFiles/Image/123.jpg,/UserFiles/Image/0319AC84.jpeg,/UserFiles/Image/123.jpg