I use this
string matchString = Regex.Match(sometext, "<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase).Groups[1].Value;
to get an images src.
But how do I can get all src what I can find?
Thanks!
You should use Regex.Matches instead of Match, and you should add the Multiline option I believe:
foreach (Match m in Regex.Matches(sometext, "<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase | RegexOptions.Multiline))
{
string src = m.Groups[1].Value;
// add src to some array
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With