需要引用单元 System.regularexpressionscore procedure TForm1.Button2Click(Sender: TObject); Var Reg: TPerlRegEx; S: String; begin S := 'abc123456'; Reg := TPerlRegEx.Create; Reg.Subject := S; Reg.RegEx := 'abc(\d+)'; while Reg.MatchAgain do Begin Memo1.Lines.Add(Reg.Groups[1]); End; end;