|
-
July 14th, 2009, 04:38 PM
#7
Re: Regular Expression in C#
 Originally Posted by Pale
I don't need to find just "value" i need to find a value that has only numbers in it.
and i know for a fact that there will only be one value= with 100% numbers after it.
I fail to see how that is relevant. When I say "value", I mean an attribute named "value" and its corresponding...value. You said yourself that you need to handle other types of attributes and tags, so why only program for each individual case when you can simply create a routine that returns attribute:
Code:
HtmlDocument myDoc = new HtmlDocument( myHtmlSource);
int value = Int32.Parse( myDoc.Nodes( "input" ).GetAttribute( "value" ) );
Nicer, eh? Now the parsing is confined to the HtmlDocument class and is reusable anywhere in code and also can do more than one thing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|