Hilfe beim auslesen eines HTML Quellcodes!

01/19/2015 23:35 BlueBasHeR#1
Hey Leute ich brauche eure hilfe!
Ich schaffe es einfach nicht einen HTML Block auszulesen... in diesem fall:

Code:
<tbody><tr>
	<td class="tcat">
		
			Preview
		
	</td>
</tr>

<tr>
	<td class="thead smallfont">
		The highlighted area indicates the maximum allowed height for your signature. Any surplus content will not be visible. The contents of [spoiler] tags may extend beyond the limit, just make sure that your signature with all spoilers collapsed is below the maximum allowed height. In addition to that, please make sure that your signature complies with the <a href="http://www.elitepvpers.com/forum/main/announcement-board-rules-signature-rules.html" rel="nofollow" target="_blank">Signature Rules</a>.
	</td>
</tr>

<tr> 
	<td class="signature-preview">
		

			
			<div class="align-center"> ######### DAS SOLL AUSGELESEN WERDEN! #########
</div>

			

			
		
	</td>
</tr>
</tbody>
Ich will den "Block" <div class="align-center"> bis </div> auslesen und ausgegeben bekommen aber mit StringRegExp geht das wohl nicht...

Wichtig ist dass ich den Block haben will ohne den HTML Codes (<div..> </div>, <br>, etc)


wäre echt nett wenn mir jemand helfen könnte bitte keine Fragen warum ich unbedingt das hier haben will ^^ wenn ich was versuche muss ich es solang machen bis es klappt :P

Autoit Code: (Ist das Example 1 in der Hilfe!)
Code:
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>

Local $aArray = 0, _
		$iOffset = 1
While 1
	$File = FileRead("1.html")

	$aArray = StringRegExp($File, '(?i)<div class="align-center">(.*?)</div>', $STR_REGEXPARRAYMATCH, $iOffset)
	If @error Then ExitLoop
	$iOffset = @extended
	For $i = 0 To UBound($aArray) - 1
		MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 1 - " & $i, $aArray[$i])
	Next
WEnd
Danke schonmal
01/19/2015 23:52 alpines#2
Der Grund warum du das mit deinem Pattern nicht auslesen kannst ist weil du das / beim </div> nicht escapest. Außerdem geht das über mehrere Zeilen und da brauchst du auch noch ein (?s).

Das richtige Pattern wäre
Code:
"(?i)(?s)<div class=""align-center"">(.+?)<\/div>"
01/20/2015 00:30 BlueBasHeR#3
Danke alpines für deine schnelle antwort bin gerade am IPhone versuche es mal morgen und dann sag ich bescheid

EDIT:Gut danke es klappt! Weisst du vieleicht noch wie ich die <br/>
raus bekomme? So dass nur der eigentliche Text zu sehen ist.
01/20/2015 17:23 alpines#4
Da ist doch kein <br/>? Oder meinst du den Zeilenumbruch? Das kannst du mit StringReplace @CR @LF oder StringStripCR bewältigen.
01/20/2015 21:12 BlueBasHeR#5
Passt schon habe alles über _IECreateEmbedded in einer form am laufen der zeigt mir das so an wie ich es haben will ^^

Danke dir nochmal!

EDIT: Habs auch nochmal mit StringReplace
Code:
Local $sString = StringReplace(FileRead("Text.html"), "<br />","")
MsgBox(0, "", $sString)