<commit_before>program test;
{$apptype console}

uses
  SysUtils,
  Classes,
  FLRE in '..\..\src\FLRE.pas',
  FLREUnicode in '..\..\src\FLREUnicode.pas';

var FLREInstance:TFLRE;
    s:ansistring;
    Captures:TFLREMultiCaptures;
    i,j:longint;
begin
 try
//FLREInstance:=TFLRE.Create('b{1,4}',[rfCASEINSENSITIVE,rfMULTILINE]);
//FLREInstance:=TFLRE.Create('\d\d\d?[\-\.\ \,\:]\d\d\d?[\-\.\ \,\:]\d\d\d\d?',[rfCASEINSENSITIVE,rfMULTILINE]);
//  FLREInstance:=TFLRE.Create('\d\d\d{0,1}[\-\.\ \,\:]\d\d\d{0,1}[\-\.\ \,\:]\d\d\d\d{0,1}',[rfMULTILINE]);
//FLREInstance:=TFLRE.Create('[a-z\dA-Z][a-z0-9-_.]?',[rfMULTILINE]);
  FLREInstance:=TFLRE.Create('(?<test>[a][bde])*(va\a?)?(hello)?c',[rfCASEINSENSITIVE,rfMULTILINE]);
  try
   s:='abc abbc advac boom';
   if FLREInstance.MatchAll(s,Captures) then begin
    for i:=0 to length(Captures)-1 do begin
     for j:=0 to length(Captures[i])-1 do begin
      write('"',copy(s,Captures[i,j].Start,Captures[i,j].Length),'" ');
      write('(',Captures[i,j].Start,',',Captures[i,j].Length,') ');
     end;
     writeln;
    end;
   end;
   writeln;
   s:=FLREInstance.ReplaceAll(s,'b"${test}"')+' k';
   writeln(s);
  finally
   FLREInstance.Free;
  end;
 except
  on e:Exception do begin<commit_msg>- Updated test.dpr<commit_after>program test;
{$apptype console}

uses
  SysUtils,
  Classes,
  FLRE in '..\..\src\FLRE.pas',
  FLREUnicode in '..\..\src\FLREUnicode.pas';

var FLREInstance:TFLRE;
    s:ansistring;
    Captures:TFLREMultiCaptures;
    i,j:longint;
begin
 try
//FLREInstance:=TFLRE.Create('b{1,4}',[rfCASEINSENSITIVE,rfMULTILINE]);
//FLREInstance:=TFLRE.Create('\d\d\d?[\-\.\ \,\:]\d\d\d?[\-\.\ \,\:]\d\d\d\d?',[rfCASEINSENSITIVE,rfMULTILINE]);
//  FLREInstance:=TFLRE.Create('\d\d\d{0,1}[\-\.\ \,\:]\d\d\d{0,1}[\-\.\ \,\:]\d\d\d\d{0,1}',[rfMULTILINE]);
//FLREInstance:=TFLRE.Create('[a-z\dA-Z][a-z0-9-_.]?',[rfMULTILINE]);
  FLREInstance:=TFLRE.Create('(?<test>[a][bde])*(va\a?)?(hello)?c',[rfIGNORECASE,rfMULTILINE]);
  try
   s:='abc abbc advac boom';
   if FLREInstance.MatchAll(s,Captures) then begin
    for i:=0 to length(Captures)-1 do begin
     for j:=0 to length(Captures[i])-1 do begin
      write('"',copy(s,Captures[i,j].Start,Captures[i,j].Length),'" ');
      write('(',Captures[i,j].Start,',',Captures[i,j].Length,') ');
     end;
     writeln;
    end;
   end;
   writeln;
   s:=FLREInstance.ReplaceAll(s,'b"${test}"')+' k';
   writeln(s);
  finally
   FLREInstance.Free;
  end;
 except
  on e:Exception do begin
{'fraction_non_alphanumeric': 0.25120385232744785, 'fraction_numerical': 0.011235955056179775, 'mean_word_length': 3.840776699029126, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3587852', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1095, 'n_words': 137}