function IsIP(const IP : String) : Boolean;
var i, dot, say : integer;
begin
Result := False;
if (Length(IP) < 7) or (Length(IP) > 15) or (IP[1] = '.') then exit;
dot := 0;
say := 0;
for i := 1 to Length(IP) do
begin
if IP[i] in ['0'..'9'] then
begin
Inc(say);
if say > 3 then exit;
end
else if IP[i] = '.' then
begin
Inc(dot);
if dot > 3 then exit;
say := 0;
end
else
exit;
end;
Result := (dot = 3) and (say in [1..3]);
end;
Umarım işinize yarar.