procedure TForm1.Button1Click(Sender: TObject);
var a:array[1..10,1..3] of string;
b1,b2,b3:String;
i,c,w:integer;
begin
b1:='(HA2L0.5+HB3L0.2+ML0.2)*3';
i:=pos('*',b1);
b3:=copy(b1,i+1,length(b1)-i);
delete(b1,i,length(b1)-i+1);
c:=0;
b1:=MP_Replacestr(b1,'(','',false,false);
b1:=Mp_ReplaceStr(b1,')','',false,false);
while b1<>'' do
begin
c:=c+1;
i:=pos('+',b1);
if i>0 then
begin
b2:=copy(b1,1,i-1);
delete(b1,1,i);
end else begin
b2:=b1;
b1:='';
end;
for i:=length(b2) downto 1 do
if not (b2 in ['0','1','2','3','4','5','6','7','8','9','.']) then
begin
w:=i;
break;
end;
a[c,1]:=copy(b2,1,w);
a[c,2]:=copy(b2,w+1,length(b2));
a[c,3]:=b3;
end;
for i:=1 to c do
showmessage(a[i,1]+' '+a[i,2]+' '+a[i,3]);
end;
//查找ss中是否有Substr替换成Newstr
function TForm1.MP_ReplaceStr(ss,SubStr,NewStr:string;RepAll,IgCase:Boolean):string;
var
a:TReplaceFlags;
begin
if RepAll=true then
include(a,rfReplaceAll);
if IgCase=true then
include(a,rfIgnoreCase);
Result:=stringReplace(ss,Substr,Newstr,a);
end;