using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?<=src="").*?(?=[\?""])";
string input = @"<iframe src=""http://www.youtube.com/embed/NM51qOpwcIM?modestbranding=1;rel=0;showinfo=0;autoplay=0;autohide=1;yt:stretch=16:9;wmode=transparent;?wmode=transparent"" allowfullscreen="" style=""width: 640px; height: 361.057px;"" frameborder=""0""></iframe>
<iframe src=""https://www.youtube.com/embed/VASywEuqFd8?feature=oembed"" allowfullscreen="" width=""660"" height=""371"" frameborder=""0""></iframe>
";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx