Lanc1988 Posted August 26, 2005 Posted August 26, 2005 I have no clue how to do any of the regex coding and ive heard its very difficult, but what i want to do seems like it shouldnt be too hard. heres what i need to do: i have my program save the source code for a webpage to a .txt file and then from that .txt file i need it to get quite a few different numbers and put them in labels. here is a section of the source code that is saved in the .txt file: <td><a href="hiscoreuser.cgi?username=lanc1988&category=0" class=c>Overall</a></td> <td align="right">90,376</td><td align="right"> 1,107 </td><td align="right"> 5,465,684 </td> ok.. now i need it to pick out the 90376, 1107, and 5465684.. now these numbers change alot but the code around them is always the same, so could someone write me a simple program that i can use as an example to do this? That code section is only one of about 10 of them. this regex code would be very nice to finally add to my program.. if you have any more questions or need any more info just tell me. thanks in advance :) Quote
IngisKahn Posted August 26, 2005 Posted August 26, 2005 Here's your RegEx string: (?<=(?:<td align="right">\s*))[\d,]+(?=(?:\s*</td>)) Quote "Who is John Galt?"
Lanc1988 Posted August 27, 2005 Author Posted August 27, 2005 i dont think that would work since the ten sectons each have that, really the only thing different on each one is the 3 numbers and also the word, in that example the word is Overall. here is two sections of the code so you can see what i mean: <td><a href="hiscoreuser.cgi?username=lanc1988&category=0" class=c>Overall</a></td> <td align="right">90,941</td><td align="right"> 1,107 </td><td align="right"> 5,465,732 </td></tr> <tr><td><img src="http://www.runescape.com/img/hiscores/attack.gif" valign="bottom" width=16 height=16 /></td><td> </td> <td><a href="hiscoreuser.cgi?username=lanc1988&category=1" class=c>Attack</a></td> <td align="right">126,920</td><td align="right"> 66 </td><td align="right"> 532,780 </td></tr> Quote
IngisKahn Posted August 27, 2005 Posted August 27, 2005 So you want a list of the three numbers each grouped by the preceeding name? Quote "Who is John Galt?"
Lanc1988 Posted August 28, 2005 Author Posted August 28, 2005 yeah.. for each title (overall, attack, strength, etc..) there are 3 numbers associated with it and i would like it to get each three and put them in labels or i may use a listview using the details property for it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.