匹配:function Match(S: string): string;
begin
Result := TRegEx.Match(S, '.+ (?<![<>:])(=+) .+').Result('$1');
end;procedure TForm1.btn1Click(Sender: TObject);
var
S:string;
begin
S:='if R1 == R2 then';
Caption:=Match(S);
end;替换:var
S:string;
begin
S:='if R1 = R2 then';
Caption:=TRegEx.Replace(S,'( = )',' == ');
end;
begin
Result := TRegEx.Match(S, '.+ (?<![<>:])(=+) .+').Result('$1');
end;procedure TForm1.btn1Click(Sender: TObject);
var
S:string;
begin
S:='if R1 == R2 then';
Caption:=Match(S);
end;替换:var
S:string;
begin
S:='if R1 = R2 then';
Caption:=TRegEx.Replace(S,'( = )',' == ');
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货