Been struggling with this for awhile. I can't seem to figure out how to get a regex request to only return the value attribute of a particular html tag. Any help is greatly appreciated.
Asked
Active
Viewed 1,749 times
1
-
Please post sample HTML and explain exactly what you want to extract from it. – Oded Apr 30 '11 at 06:40
-
1Oh my god, this site has to be renamed RegexOverflow! – manojlds Apr 30 '11 at 06:42
-
You have a `C#` and a `.net` tag on your question, why don't you just read the value on the postback of the page? – Bazzz Apr 30 '11 at 06:44
2 Answers
3
Are you trying to parse HTML with Regex? Don't or you will continue to struggle. Use SgmlReader or HTML Agility Pack for this purpose.

Community
- 1
- 1

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
0
RegEx is not a good solution for parsing unstructured (or unknown) HTML.
See this SO post for compelling reasons why this is the case.
I suggest using a parser such as the HTML Agility Pack and querying the parsed document.