I am working on an old website, and i need to fix my youtube links. for example, i have a string variable with the following content:
<h1>title</h1>
<p>
some text here
.......
<iframe src="http://www.youtube.com/embed/suEGD8aaSzI?list&playauto=1" width="560" height="315" frameborder="0" scrolling="auto"></iframe>
.......
</p>
</p>
i try to get the parameters "suEGD8aaSzI?list&playauto=1" outside, to do the following:
lblContent.Text = Regex.Replace(ArticleContent, @"myRegularExpressionHere", "https://www.youtube.com/embed/$1", RegexOptions.IgnoreCase);
so far, its the best what i could find:
https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v\=))([\w-]{10,12})(?:[\&\?\#].*?)*?(?:[\&\?\#]t=([\dhm]+s))?(?=")
but it is not enough, because i get only the "suEGD8aaSzI" as a parameter, the rest of the query string: "?list&playauto=1" is not included inside.
help will be very appreciated.