Bonjour,

je voudrai faire une regex sur une page web.
voici m regex :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
$regex = '@<h3>
			<a href="#">&nbsp;&nbsp;
				<span class="foot_news_title_MU">(*)</span>&nbsp;&nbsp;
				<span class="Text_Today_Time">GMT+1</span>
				<span class="Text_news_big_Syn">&nbsp;|&nbsp;<strong>(*)</strong></span>
			</a>
			</h3>
			<div style="padding:5px;" align="left">
				<table width="99%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="center" valign="middle" width="170">
							<img src="(*)" width="150" height="95" title="*" alt="*" />
						</td>
						<td align="left" valign="middle" class="Text_news_small_Syn">(*)</td>
					</tr>
				</table>
			</div>@';
Je lui applique la fonction clean pour echapper tous les caracteres spéciaux :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function clean($string){
	$string = str_replace(".","\.",$string);
	$string = str_replace("+","\+",$string);
	$string = str_replace("-","\-",$string);
	$string = str_replace("*","\*",$string);
	$string = str_replace("?","\?",$string);
	$string = str_replace("|","\|",$string);
	$string = str_replace("-","\-",$string);
	$string = str_replace("$","\$",$string);
	$string = str_replace("()","\()",$string);
	$string = str_replace("(","\(",$string);
	$string = str_replace(")","\)",$string);
	$string = str_replace("{}","\{}",$string);
	$string = str_replace("{","\{",$string);
	$string = str_replace("}","\}",$string);
	$string = str_replace("[]","\[]",$string);
	$string = str_replace("[","\[",$string);
	$string = str_replace("]","\]",$string);
 
	return $string;
}
Malgré ça, mon code ne marche pas.

voici la partie de la page qui doit satisfaire l'expression réguliere :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<h3><a href="#">&nbsp;&nbsp;<span class="foot_news_title_MU">00:45</span>&nbsp;&nbsp;<span class="Text_Today_Time">GMT+1</span><span class="Text_news_big_Syn">&nbsp;|&nbsp;<strong>NESS NESSMA &ndash; Rediffusion</strong></span><br/>&nbsp;&nbsp;Commence dans 3 heures et 3 minutes.</a></h3>
 
                    <div style="padding:5px;" align="left">
 
                      <table width="99%" border="0" cellspacing="0" cellpadding="0">
 
                        <tr>
 
                          <td align="center" valign="middle" width="170"><img src="assets/front/grille/ness150x95.jpg" width="150" height="95" title="NESS NESSMA – Rediffusion" alt="NESS NESSMA – Rediffusion" /></td>
 
                          <td align="left" valign="middle" class="Text_news_small_Syn">
 
						  						  </td>
 
                        </tr>
 
                      </table>
 
                    </div>
Merci pour vos réponses.