Which regex unit to use?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Which regex unit to use?

Graeme Geldenhuys-2
Hi,

There are a few regex units include with FPC and Lazarus, and dozens more
available for Delphi (and probably FPC too).

Which one is the most well known, or best to use, or most feature complete
regarding syntax etc...?

 * <fpcsrc>/packages/regexpr/src/old/regexpr.pp
 * <fpcsrc>/packages/regexpr/src/regexp.pp
 * <lazarus>/components/synedit/synregexpr.pas
 * TRegExpr (no idea what is latest and if FPC compatible)
 * ....?


I guess I'm looking for something similar or compatible with PCRE syntax,
but in native Object Pascal, so it can be compiled into my applications.


Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Which regex unit to use?

Graeme Geldenhuys-2

Has anybody done a speed test between these two, to see how they perform
with large test files?


>  * <fpcsrc>/packages/regexpr/src/regexp.pp

vs

>  * <lazarus>/components/synedit/synregexpr.pas
>  * TRegExpr (no idea what is latest and if FPC compatible)



>From the following link it sounds like TRegExpr is dog slow - even the
original author said so (referring that it was only meant for small lines
of text).

http://z505.com/cgi-bin/qkcont/qkcont.cgi?p=TRegExpr%20Considered%20Harmful



Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Which regex unit to use?

Seth Grover
In reply to this post by Graeme Geldenhuys-2
> Hi,
>
> There are a few regex units include with FPC and Lazarus, and dozens more
> available for Delphi (and probably FPC too).
>
> Which one is the most well known, or best to use, or most feature complete
> regarding syntax etc...?
>
>  * <fpcsrc>/packages/regexpr/src/old/regexpr.pp
>  * <fpcsrc>/packages/regexpr/src/regexp.pp
>  * <lazarus>/components/synedit/synregexpr.pas
>  * TRegExpr (no idea what is latest and if FPC compatible)
>  * ....?
>
>
> I guess I'm looking for something similar or compatible with PCRE syntax,
> but in native Object Pascal, so it can be compiled into my applications.
>
>
> Regards,
>  - Graeme -

I have had good luck with TRegExpr and have been using it in FPC for a
long time.

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Which regex unit to use?

Joost van der Sluis
In reply to this post by Graeme Geldenhuys-2
On Fri, 2010-02-26 at 09:56 +0200, Graeme Geldenhuys wrote:

> Hi,
>
> There are a few regex units include with FPC and Lazarus, and dozens more
> available for Delphi (and probably FPC too).
>
> Which one is the most well known, or best to use, or most feature complete
> regarding syntax etc...?
>
>  * <fpcsrc>/packages/regexpr/src/old/regexpr.pp
>  * <fpcsrc>/packages/regexpr/src/regexp.pp

use
 <fpcsrc>/packages/regexpr/src/regex.pp

The regexp unit is a wrapper for backwards compatibility.

If you want to know something about speed, use the shootout. Although
for some reason the implementation for regex-dna is not submitted to the
shootout. But you can find the source in <fpcsrc>/tests/bench/shootout.

Joost


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal