I'm trying to make a small program that will do a search on YouTube. I've managed to extract the title and get it to display but I am having trouble with the description.

In the page source it looks like

<span  id="RemainvidDescdMH0bHeiRNg" style="display: none"> DESCRIPTION HERE </span>

Now usually it would be generally easy because you could just write

Match description = Regex.Match(html, @"<span  id=RemainvidDescdMH0bHeiRNg style=display: none>\s*(.+?)\s*</span>");

But the annoying thing is... In the id=RemainvidDescdMH0bHeiRNg, the dMH0bHeiRNg is a unique ID to each individual video. How would I change the above code to match the ID?

Then change it to

Match description = Regex.Match(textBox1.Text, @"<span  id=(.*)style=display: none>(.*)</span>");

That returns the 2 sections you're after

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.