There are many times I need to extract value of an element from a HTML page. Something like this:
<!-- many html here -->
<input type="hidden" name="id" value="ExtractMe!">
<!-- many html here -->
How can extract the value easily?
Have a look at the HTMLAgility pack, it makes this type of task very easy and regex-free.
If you need to parse HTML within your C# application consider using HTMLAgilityPack from here http://htmlagilitypack.codeplex.com/
If you just want to pluck values you're probably best to parse this as XML. You have a choice of standard XML or LINQ.
Why don't you use regular expressions? This the MSDN Regular Expression Documentation, in there you can look for The section Extracting a Single Match or the First Match
.