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
  • 981
  • 2
  • 9
  • 27
Vadim
  • 3,116
  • 2
  • 14
  • 22

1 Answers1

0

Try the following:

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

You were missing the parenthesis.

Uri Y
  • 830
  • 4
  • 12