Delimiteur expression réguliere

Résolu
stanilou Messages postés 193 Date d'inscription mercredi 5 mai 2004 Statut Membre Dernière intervention 18 novembre 2009 - 2 mai 2005 à 13:57
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 - 2 mai 2005 à 14:27
Salut,

mon code:

<?php

$aaa = "salut ca va ? t cool la?";

if (preg_match("va|kf|allo"',$aaa)) {

echo 'ok';

} else {

echo 'non';

}

?>



Et le test de ce programme me dit:

Warning: Delimiter must not be alphanumeric or backslash in d:\mes documents\site crée\php\site\autre\test.php on line 3



Quelqu'un aurais une idéé?

En fait moi je veux chercher "va" ou "kf" ou "allo" dans la chaine
$aaa,donc dans "salut ca va ? t cool la?". Le probleme c'est que là
c'est juste pour tester mais enfait je veux chercher a peu près 20 truc
dans une chaine beaucoup plus grande...



Quelqu'un aurais une idéé?

Merci d'avance



Natsboss




<hr size ="2" width="100%">Visiter mon site: http://natsboss.c.la

Actu: - Un nouveau Forum (fait par moi) /!\ NEW /!\

- Plein d'autre chose...

3 réponses

malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
2 mai 2005 à 14:06
Hello,



<?php

$aaa = "salut ca va ? t cool la?";

if (preg_match("(va|kf|allo)",$aaa)) {

echo 'ok';

} else {

echo 'non';

}

?>
3
stanilou Messages postés 193 Date d'inscription mercredi 5 mai 2004 Statut Membre Dernière intervention 18 novembre 2009
2 mai 2005 à 14:08
Merci beaucoup!!!!

<hr size="2" width="100%">Visiter mon site: http://natsboss.c.la

Actu: - Un nouveau Forum (fait par moi) /!\ NEW /!\

- Plein d'autre chose...
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
2 mai 2005 à 14:27
De rien !!!! ;-)
0
Rejoignez-nous