0

I have an HTML text, where I want to find images and videos. Found some examples, but can't make it work.

I have working example for only images:

MatchCollection urls = Regex.Matches(this.item.text, "<img.+?src=[\\\"'](.+?)[\\\"'].*?> );

For both i want to make something like this:

MatchCollection urls = Regex.Matches(this.item.text, "<img.+?src=[\\\"'](.+?)[\\\"'].*?> | <iframe .*?/> | <iframe .*?</iframe>");

The last regex found 0 images, where first got 3.

vlad.rad
  • 1,055
  • 2
  • 10
  • 28
Vadim
  • 3,855
  • 2
  • 17
  • 22

1 Answers1

0

Try the following:

(<img.+?src=[\\\"'](.+?)[\\\"'].*?>)|((<iframe.*?\/>)|(<iframe.*?<\/iframe>))

You were missing the parenthesis.

Uri Y
  • 840
  • 5
  • 13