Another one:
program replace2;
{$I DIRECTIVES}
uses
SysUtils,
Classes,
FLRE in '..\..\src\FLRE.pas',
FLREUnicode in '..\..\src\FLREUnicode.pas';
var
re: TFLRE;
pattern, subject: TFLRERawByteString;
begin
subject := '05/09/2015';
pattern := '(\d+)/(\d+)/(\d+)';
re := TFLRE.Create(pattern, []);
re.MaximalDFAStates := 65536;
WriteLn(re.ReplaceAll(subject, '\3/\2/\1'));
re.Free;
ReadLn;
end.
Result:
2015/09/05
Is it possible to use a function as second argument ?