i, j, idx : Integer;
begin
URL := Trim(LowerCase(URL));
- idx := AnsiPos('?', URL);
+ for i := 0 to Length(START_NAME) -1 do begin
+ idx := AnsiPos(START_NAME[i], URL);
+ if (idx <> 0) then begin
+ break;
+ end;
+ idx := AnsiPos(END_NAME[i], URL);
+ if (idx <> 0) then begin
+ break;
+ end;
+
+ end;
+
if (idx <> 0) then begin
+ idx := AnsiPos('?', URL);
+ if (idx = 0) then begin
+ idx := LastDelimiter('/', URL);
+ end;
stRes := 0;
endRes := 0;
bufList := TStringList.Create();
for i := 0 to bufList.Count - 1 do begin
convBuf := '';
// \8aJ\8en\83\8c\83X\94Ô\82Ì\8c\9f\8dõ
- for j := 0 to Length(START_NAME) - 1 do begin
- idx := AnsiPos(START_NAME[j], bufList[i]);
- if (idx <> 0) then begin
- convBuf := Copy(bufList[i], idx + Length(START_NAME[j]), Length(bufList[i]));
- stRes := StrToInt64Def( convBuf, 0 );
- break;
+ if (stRes = 0) then begin
+ for j := 0 to Length(START_NAME) - 1 do begin
+ idx := AnsiPos(START_NAME[j], bufList[i]);
+ if (idx = 1) then begin
+ convBuf := Copy(bufList[i], idx + Length(START_NAME[j]), Length(bufList[i]));
+ stRes := StrToInt64Def( convBuf, 0 );
+ break;
+ end;
end;
end;
// \8fI\97¹\83\8c\83X\94Ô\82Ì\8c\9f\8dõ
- if (convBuf = '') then begin
+ if (convBuf = '') and (endRes = 0) then begin
for j := 0 to Length(END_NAME) - 1 do begin
idx := AnsiPos(END_NAME[j], bufList[i]);
- if (idx <> 0) then begin
+ if (idx = 1) then begin
convBuf := Copy(bufList[i], idx + Length(END_NAME[j]), Length(bufList[i]));
endRes := StrToInt64Def( convBuf, 0 );
break;
if ((stRes = 0) and (endRes = 0) and (convBuf = '')) then begin
for j := 0 to Length(RES_NAME) - 1 do begin
idx := AnsiPos(RES_NAME[j], bufList[i]);
- if (idx <> 0) then begin
+ if (idx = 1) then begin
convBuf := Copy(bufList[i], idx + Length(RES_NAME[j]), Length(bufList[i]));
stRes := StrToInt64Def( convBuf, 0 );
endRes := stRes;