Bonjour à tous et à toute,
admettons j'ai un code HTML comme ceci :
1 2 3 4 5
| <table width="153" border="0" cellspacing="0" cellpadding="0" class="moment">
<tr><td align="center" valign="bottom" class="artiste_moment"><a href="javascript:popUp('http://player.cheriefm.fr/V4/cheriefm/cheriefm_launch_V3.html','630','240','no')" class="texte10">Jean-Jacques Goldman</a></td></tr>
<tr><td align="center" valign="middle" class="tof_moment"><a href="javascript:popUp('http://player.cheriefm.fr/V4/cheriefm/cheriefm_launch_V3.html','630','240','no')"><img src="http://cache.yacast.fr/V4/img_tmp/T_552_177232.JPG" width="80" height="80" alt="" border="0"></a></td></tr>
<tr><td align="center" valign="top" class="titre_moment"><a href="javascript:popUp('http://player.cheriefm.fr/V4/cheriefm/cheriefm_launch_V3.html','630','240','no')" class="texte10">Elle attend</a></tr>
</table> |
je souhaite extraire le contenu des balise <td> dont la class (en HTML) est egale à "artiste_moment" et "titre_moment" (mais exlure tof_moment), j'avais procédé ainsi :
preg_match_all('/<td .+ class="\w+">(.+)<[\/td|\/tr]+>/iU',$content,$result);
la il me prend les 3 celulle ("titre_moment", "artist_moment" et "tof_moment")
est-il possible dans mon pattern de rajouter un tite condition qui exclu la class qui commence par le sous-masque "tof" si je fait [^tof] ca va pas, il me retire aussi "titre_moment" ca il commence par "t" (logique) 
merci de votre aide.
Partager