Précédent   Forum des professionnels en informatique > PHP > Langage > Regex
Regex Forum d'entraide sur les expressions rationnelles PHP. Avant de poster -> FAQ regex, Cours de regex et Sources de regex
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 22/07/2007, 23h27   #1
Membre confirmé
 
Homme
Inscription : septembre 2002
Messages : 475
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 29
Localisation : France

Informations forums :
Inscription : septembre 2002
Messages : 475
Points : 222
Points : 222
Par défaut Problème avec '<' et ?

Bonsoir,

Je souhaiterai récupérer les informations de cette chaine via l'expression régulière suivante :

Code :
1
2
3
4
 
$source = '<table BORDER="0" CELLPADDING="5" width="580" ><tr><td height="194"><h3><font face="arial"> Latest Observation(s)</font></h3><font face="arial"><H3>LFQQ</H3><P>The most recent observation in our system was generated at the source at:</P><P><FONT COLOR="#48D1CC"><B>2007/07/22 20:30 UTC</B></FONT></P><P>The observation is:</P></font><font face="courier" size = "5">XXXXXX YYYYYY ZZZZZZZZZZ</font><hr></FONT></TT></P></td></tr></table>';
$motif = '<P><FONT COLOR="#48D1CC"><B>(.*)</B></FONT></P>.*<font face="courier" size = "5">(.*)</font>';
preg_match_all($motif,$source,$sortie);
J'ai cependant un petit soucis :
Citation:
Warning: preg_match_all(): Unknown modifier '<' in C:\script.php on line 42
Merci,
MaTHieU_
__________________
Embarcadero RAD Studio XE / Microsoft Windows 7 Édition Intégrale (64 bits)
MaTHieU_ est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/07/2007, 00h31   #2
Membre confirmé
 
Homme
Inscription : septembre 2002
Messages : 475
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 29
Localisation : France

Informations forums :
Inscription : septembre 2002
Messages : 475
Points : 222
Points : 222
J'avais oublié mes delimiteurs '~'.

C'est OK.

MaTHieU_
__________________
Embarcadero RAD Studio XE / Microsoft Windows 7 Édition Intégrale (64 bits)
MaTHieU_ est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 23h03.


 
 
 
 
Partenaires

Hébergement Web