...

View Full Version : easy regular expression help plz



fatrat
11-16-2006, 11:39 AM
<tr colData0='[5thP]CPL.Hitman.5' colData1='1162585564' colData2='-4' colData3='offline' >
<td class="m_est_clan_member_name_col">
<a href="/profile/rjpaul1989">[5thP]CPL.Hitman.5</a>
</td>


<td class="m_est_clan_member_join_col">
Nov 3, 2006
</td>

<td class="m_est_clan_member_rank_col">
Member 4
</td>

<td class="m_est_clan_member_status_col">
offline
</td>
</tr>



<tr colData0='[5thP]SSG.NeZoRiL.5' colData1='1162575984' colData2='-3' colData3='offline' >
<td class="m_est_clan_member_name_col">
<a href="/profile/nezoril">[5thP]SSG.NeZoRiL.5</a>
</td>

<td class="m_est_clan_member_join_col">
Nov 3, 2006
</td>

<td class="m_est_clan_member_rank_col">
Member 3
</td>


<td class="m_est_clan_member_status_col">
offline
</td>
</tr>


hi, from the above code i would like to extract the blue and green parts, so that i can compile a list of users and there status.

plz can somebody help.

SeeIT Solutions
11-16-2006, 11:42 AM
It would be easier to get it from the coldata0='[5thP]CPL.Hitman.5'.

I can do it without regular expressions, but obviously they would be faster. Let me know if you want it done another way.

fatrat
11-16-2006, 11:55 AM
the fastest way is best ;)

SeeIT Solutions
11-16-2006, 12:00 PM
Sorry, can't help u then :)

fatrat
11-16-2006, 12:17 PM
i didnt notice the 'coldata0=' parts, so after u posted i managed to get it working using them. So, you were a big help actually, ty.


$log = file_get_contents('http://www.xfire.com/clans/5thplatoon/');
preg_match_all('/(colData0=\')(.+?)(\' colData1=)/', $log, $matches);
preg_match_all('/(colData3=\')(.+?)(\' >)/', $log, $matches2);

SeeIT Solutions
11-16-2006, 12:22 PM
Ha, np then ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum