suche matchcode oder ähnliches
-
Hallo,
ich habe in einem AnsiString diesen Text:
<IFRAME SRC='http://meinedomain.eu/ddtsccht.php?cvar=31PI4&ch=391&cfgid=_0999' WIDTH=0 HEIGHT=0
FRAMEBORDER=0 SCROLLING=no ALIGN=center id = '1111'></IFRAME>mich interressiert nun, was zwischen <IFRAME SRC=' und ' WIDTH=0 HEIGHT=0 steht.
Wie kann ich nur diesen Teil herausschneiden, wenn ich die Position nicht kenne?
-
Achja, die länge des Strings kenne ich auch nicht
-
Schau mal in die Hilfe zu AnsiString::Pos und ::SubString.
-
hallo,
ich habe das jetzt so:
pos1 = Pos(Inhalt, "<IFRAME SRC='");
pos2 = Pos(Inhalt, "' WIDTH=0 HEIGHT=0");
Application->MessageBoxA(SubString(pos1, pos2 - pos1).c_str(), "test");Leider kennt der BCB die Funktion Pos und SubString nicht.
was muss ich einfügen?
welches *.h
-
erledigt.
pos1 = AnsiPos(Inhalt, "<IFRAME SRC='");
pos2 = AnsiPos(Inhalt, "' WIDTH=0 HEIGHT=0");
Application->MessageBoxA(Inhalt.SubString(pos1, pos2 - pos1).c_str(), "test");
-
Nein, doch noch nicht.
int pos1, pos2; pos1 = AnsiPos(Inhalt, "<IFRAME SRC='"); pos2 = AnsiPos(Inhalt, "' WIDTH=0 HEIGHT=0"); Application->MessageBoxA(Inhalt.SubString(Inhalt.Length() - 500, 500).c_str(), "kk"); Application->MessageBoxA(AnsiString(pos1).c_str(), "kk"); Application->MessageBoxA(AnsiString(pos2).c_str(), "kk"), Application->MessageBoxA(Inhalt.SubString(pos1, pos2 - pos1).c_str(), "test");Obwohl der Code enthalten ist, wird er nicht gefunden.
pos1 und pos2 ist immer null.
Obwohl der Code-Teil in
Application->MessageBoxA(Inhalt.SubString(Inhalt.Length() - 500, 500).c_str(), "kk");
Angezeigt wird.....
-
Das Tutorial das ich gelesen habe, ware fehlerhaft, die parameter von AnsiPos müssen vertauscht werden