1

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.

3
  • Please post sample HTML and explain exactly what you want to extract from it. Commented Apr 30, 2011 at 6:40
  • 1
    Oh my god, this site has to be renamed RegexOverflow! Commented Apr 30, 2011 at 6: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? Commented Apr 30, 2011 at 6:44

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.