Page 1 sur 1
[R] Pattern incorecte
Posté : lun. 08 juin 2009 23:14
par L4crymal
j'utilise ce pattern pour récupérer dans un fichier text tout ce qui se trouve entre les balises <tr> et </tr> :
"(?i)<tr>(.*?)</tr>"
Code :
► Afficher le texte
Code : Tout sélectionner
if FileExists ("ici.txt") Then
$read=FileRead("ici.txt")
If @error = -1 Then MsgBox(0,"","")
$strhost=StringRegExp($read,"(?i)<tr>(.*?)</tr>",3)
MsgBox(0,"",UBound($strhost))
For $i=0 to UBound($strhost)-1 Step 1
FileWrite("log.txt",$strhost[$i]&@CRLF)
Next
Else
EndIf
Mais cela ne fonctionne pas :s
Apparemment il ne prend pas en compte les saut de ligne...
Merci d'avance pour votre aide
Re: [..] Pattern incorecte
Posté : lun. 08 juin 2009 23:17
par Iste
heu, je suis pas un pro, alors j'use
#Include <string.au3>
_StringBetween($sString, $sStart, $sEnd[, $vCase = -1[, $iSRE = -1]])
Edit :
Sinon, je vois que t'as lu la doc, mais aurais-tu négligé cette ligne ?
(?s) : . matches anything including newline. (by default "." don't match newline)
Re: [..] Pattern incorecte
Posté : lun. 08 juin 2009 23:18
par L4crymal
MAGNIFIQUE
