|
Publicité ' | |||||||||||||||||||||||
|
|
#1 |
|
Membre à l'essai
![]() Inscription : novembre 2006 Messages : 62 ![]() |
Bonjour
j'espère que je suis dans le bon forum j'ai recherché "regex" et "expression" dans la page des forums Je cale avec preg_match_all voici mon motif : voici un exemble de la chaine dans laquelle on cherche le motif : Code :
<strong>Blabla 1</strong></td><strong>Blabla 2</strong></tr><strong>Blabla 3</strong></h1></strong> et uniquement lui Jusqu'a maintenant il prend tout jusqu'a la fin ( dernier </strong> ) ! Comment faire pour lui demander " prend jusqu'au premier </strong>
|
|
|
00
|
|
|
#2 |
|
Membre émérite
![]() Inscription : mai 2004 Messages : 709 ![]() |
La gourmandise est un vilain défaut (mais parfois bien utile dans les regex).
Ton quantificateur * prendra tout ce qu'il peut jusqu'au dernier </strong>. Comportement normal. Pour rendre le quantificateur de ton masque non-gourmand: #<strong>(.*?)</strong># ou #<strong>(.*)</strong>#U http://www.lumadis.be/regex/tuto_pcre.php#gourmand
__________________
:q :q! :wq :w :w! :wq! :quit :quit! :help help helpquit quit quithelp :quitplease :quitnow :leave :shit ^X^C ^C ^D ^Z ^Q QUITDAMMIT Jabber: ripat at im.apinc.org |
|
|
00
|
|
|
#3 |
|
Membre à l'essai
![]() Inscription : novembre 2006 Messages : 62 ![]() |
|
|
|
00
|
Copyright © 2000-2012 - www.developpez.com