end;
else begin //match given single char.
if (asource[0] <> apattern[0]) then
begin
result := false;
break;
end;
//continue testing next char...
inc(asource);
inc(apattern);
end;
end;
end;
end;
function matchpattern(const apattern, asource: string): boolean;
begin
result := _matchpattern(pchar(apattern), pchar(asource));