Should I use regex to parse this string of html table data?

v7web

New Member
What's the best way to parse this data? Should I use regex or something else? The data is in html, but I found it from a website and will be parsing this and only this string (note: string is much longer - over 1,300 instances - only two below) - note I use php & jquery for most web programming. I only need to extract the data in the second td and only the anchor text inside the anchor - in instance 1, it's: Best, Jahvid DET RBAnd I only need to run this loop one time. \[code\]<tr class="oddtablerow"><td class="rank">1.</td><td class="rank">1.</td><td class="player"><a href="http://football22.myfantasyleague.com/2010/player?L=34793&P=9839" title="Salary: $2250000, Year: 3, Status: 3, Info: Drafted 10 1:04 Team, Week 3: at Vikings Sun 1:00 p.m. ET" class="position_rb">Best, Jahvid DET RB</a> (R) </td><td class="points tot">53.90</td><td class="points avg">26.950</td><td class="points"><a href="http://stackoverflow.com/questions/3765758/detailed?L=34793&W=1&P=9839&YEAR=2010">17.55</a></td> <td class="points"><a href="http://stackoverflow.com/questions/3765758/detailed?L=34793&W=2&P=9839&YEAR=2010">36.35</a></td> <td class="status"><a title="Owner: William Gold" class="franchise_0009" href="http://football22.myfantasyleague.com/2010/options?L=34793&F=0009&O=01">Team Name</a> - <a href="http://stackoverflow.com/questions/3765758/options?L=34793&O=05&FRANCHISE=0013,0009&PLAYER=9839,">Trade</a></td><td class="week">7</td><td class="salary">$2250000</td></tr> <tr class="eventablerow myfranchise "><td class="rank">2.</td><td class="rank">2.</td><td class="player"><a href="http://football22.myfantasyleague.com/2010/player?L=34793&P=3291" title="Salary: $7400000, Year: 3, Status: 3, Info: , Week 3: at Broncos Sun 4:15 p.m. ET" class="position_qb">Manning, Peyton IND QB</a></td><td class="points tot">49.61</td><td class="points avg">24.805</td><td class="points"><a href="http://stackoverflow.com/questions/3765758/detailed?L=34793&W=1&P=3291&YEAR=2010">26.66</a></td> <td class="points"><a href="http://stackoverflow.com/questions/3765758/detailed?L=34793&W=2&P=3291&YEAR=2010">22.95</a></td> <td class="status"><a title="Owner: Robert M. Cavezza " class="myfranchise franchise_0013" href="http://football22.myfantasyleague.com/2010/options?L=34793&F=0013&O=01">The Bullies</a></td><td class="week">7</td><td class="salary">$7400000</td></tr> \[/code\]Edit: What happened to the jquery answer? I was about to implement it but it disappeared
 
Back
Top