function gethtml(str_url:string):string;
var
inputdata:pointer;
msdata:Tmemorystream;
httpclient:Tidhttp;
begin
result:='';
msdata:=Tmemorystream.Create();
httpclient:=Tidhttp.Create();
msdata.Clear;
httpclient.Get(str_url,msdata);
getmem(inputdata,msdata.Size);
msdata.Position:=0;
msdata.ReadBuffer(inputdata^,msdata.Size);
result:=strpas(inputdata);
freemem(inputdata,msdata.size);
end;
引用正式表达式
uses
VBScript_regexp_55_TLB;
function testregule(str_xx:string):string;
var
objexp:TRegexp;
machs:imatchcollection;
matchs:match;
i: Integer;
begin
objexp:=TRegexp.create;
objexp.pattern:='';
objexp.ignorecase:=true;
objexp.global:=true;
machs:=objexp.exceute(str_xx) as imatchcollection;
for i := 0 to machs.Count - 1 do
begin
matchs:=machs.Item[i] as match;
end;
end;