Hi, see the picture attached. Debuger raises a exception: unrecognized modifier(pos2)
I'm testing in Ubuntu x64 20.04 with Lazarus 2.10 with this code
program project1;
{$mode objfpc}{$H+}
uses {$IFDEF UNIX} {$IFDEF UseCThreads}
cthreads, {$ENDIF} {$ENDIF}
Classes { you can add units after this },
RegExpr;
var
txt, buf, filename: string;
fileHtml: Textfile;
reg: TRegExpr;
begin
//write('Name of html-file: ');
//read(filename);
//AssignFile(fileHtml, filename);
//Reset(fileHtml);
//txt:='';
//while not Eof(fileHtml) do
//begin
// Readln(fileHtml, buf);
// txt:=txt+buf;
//end;
txt := '<html> <head> <title>Esta es mi primera pagina</title> </head> <body> <h1>Esto es un encabezado</h1> <p>Y esto es un parrafo, donde podemos escribir todo el rollo que se nos ocurra.</body></html>';
reg := TRegExpr.Create('(<img.+?>)(?![\s\S]*\1)');
if (reg.Exec(txt)) then
repeat
writeln(reg.Match[0]);
until not reg.ExecNext;
end.
/BlueIcaro