TPerlRegExComputeReplacement (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example uses the TPerlRegEx ComputeReplacement method. This example will show a messagebox saying "Foo is the name of the bar I like".

Code

with PerlRegEx1 do begin
  Subject := 'I like to hang out at Foo bar';
  RegEx := '([A-Za-z]+) bar';
  Replacement := '\1 is the name of the bar I like';
  if Match then ShowMessage(RegEx.ComputeReplacement);
end;

Uses