[fpc-pascal] Re: Mattias Gaertner: regexpr

L505 fpc505 at z505.com
Mon May 16 00:10:47 CEST 2005


Oops, error in my last program I sent to the list, I  meant this:

Program ExampleRegexpr;

Uses
 Regexpr2;

{
Program to demonstrate the secondary Regular expression unit
  Note: not the one by Florian, but the RegexprStudio.
}

const
 InputStr : PChar = 'This is a simple string.';
var
      TestRgx:tregexpr;
begin
   testrgx:=tregexpr.create;
   testrgx.expression:='i(.*)s';
   testrgx.exec(InputStr);
   writeln('The main match: ',  testrgx.Match[0]);
   writeln('The first back reference match: ',  testrgx.Match[1]);
   If testrgx <> nil then
   begin
    testrgx.free; //should have used FreeAndNil!
    testrgx:=nil;
   end;
   readln;

end.

----Original Message----
| Program ExampleRegexpr;
| Uses
|  Regexpr2;

| {
| Program to demonstrate the secondary Regular expression unit
|   Note: not the one by Florian, but the RegexprStudio.
| }





More information about the fpc-pascal mailing list