[Lazarus] What's the correct way to use TRegexEngine?

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Dec 23 10:55:33 CET 2011


On 23 December 2011 11:29, silvioprog <silvioprog at gmail.com> wrote:
>
> The regex that he indicated uses LCL yes! >> "[LCL]SynRegExpr.TRegExpr".

Look inside that unit. It is the TRegExpr library originally created
by Andrey V. Sorokin for Delphi. It has no dependency on LCL units at
all, only the RTL. Simply copy that unit into your project, give it a
better name and use it. It is a lot more powerful and feature
complete, compare to what comes with any released FPC.

>
> The regex that I'm using belongs to FCL. >> "[FCL]RegEx.TRegexEngine".

As far as I remember the regex unit included in FCL (released versions
of FPC) is pretty limited in what it can do. I would not use that for
any regex project. Use the TRegExpr library instead.

Only recently did someone include a more powerful regex engine in FPC
trunk - but I don't know how that one compares to the one from Andrey
V. Sorokin.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net




More information about the Lazarus mailing list