How to get all src images from some html
1 answer
You should use Regex.Matches instead of Match, and you should add the Multiline parameter, which I consider:
foreach (Match m in Regex.Matches(sometext, "<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase | RegexOptions.Multiline))
{
string src = m.Groups[1].Value;
// add src to some array
}
+8