function MyExtractStr(const Str:String):TStrings;
const
NumChar:set of Char=['0'..'9','.'];
var
i:Integer;
LastChar:Char;
LastIsAlpha,IsAlpha:Boolean;
mstr:String;
begin
Result:=TStringList.Create;
if Str='' then
exit;
mstr:='';
LastChar:=Str[1];
LastIsAlpha:=not (LastChar in NumChar);
for i:=1 to Length(Str)do
begin
IsAlpha:=not (Str in NumChar);
if LastIsAlpha xor IsAlpha then
begin
Result.Add(mstr);
mstr:=Str;
LastIsAlpha:=IsAlpha;
end
else
mstr:=mstr+Str;
end;
if mstr<>'' then
Result.Add(mstr);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with MyExtractStr('a1b2c3a1.5b3c8a8')do
begin
ShowMessage(Text);
Free;
end;
end;