Page 1 of 2

Time to switch to a more standard regexp engine ?

Posted: 2006-11-07, 14:07 UTC
by PoV
I just love TC, and the new version seems to bring some nice enhancements and it looks very promising.
I just learned about it when checking out the site because I got stuck trying to enter a regexp while searching for files. It turns out the engine used by TC is not a fully POSIX compliant one (ok, I'm your regexp-crasy kind of guy), and I'll have to rely on some external tool to find the matches I'm looking for. Since this is a new version, maybe it's time to upgrade the engine ? I know you're using a pascal/delphi engine for TC because that's the language you're using, but I have the feeling it should be possible to use the standard POSIX c lib inside TC with the correct binding. My Pascal/Delphi is aging, but if it's possible to call the standard Windows API, why not some functions in a c lib ?

FYI, here's the regexp I was using...

Code: Select all

{\$(?:[^e}]|e(?!scape))*}
It's to find all {$random_chars} variations which don't contain 'escape'.

Posted: 2006-11-07, 14:22 UTC
by SanskritFritz
Total Commander Help wrote:Total Commander uses the free Delphi library TRegExpr by Andrey V. Sorokin: http://regexpstudio.com/

Posted: 2006-11-07, 14:29 UTC
by majkinetor !
I agree

FYI, there is unofficial beta version of AutoHotKey available with support for Perl RegExp.

SInce I was there while it was discussed I noted that they managed to find some very small and very fast library that is changed a little to be even more smaller. As the effect, the file size of AHK executable has rised no more then 40KB with full reg exp support including search & replace option. I guess this solution is much better and smaller then TRegExpr and it can even lead to smaller exe. Ghisler can use it via LoadLibrary. It is also much faster as it doesn't heave class overhead and doesn't use functions in alghorytm but plain goto's. We tested it extensively so far, and string operation routines are even faster then some non-re string manipualiton routines in AHK.

BTW, c functions can be called from Delphi only using DLLs (static or dynamic)

EDIT: Ups, its just got official
Version 1.0.45 adds support for regular expressions via RegExMatch(), RegExReplace(), and SetTitleMatchMode.

Posted: 2006-11-08, 07:23 UTC
by icfu
TRegExpr is indeed very limited. I support a switch to a better library of course. Look ahead, look behind, often missed till now. The more power, the better! :)

The new AHK documentation has even become better than it has ever been with colouring. Also the RegEx quick reference is very, very nice.

Icfu

Posted: 2006-11-08, 08:07 UTC
by WatchUer
Support!!!

Posted: 2006-11-08, 11:26 UTC
by solid
Defenitely support.
Current regex library doesn't support positive or negative lookahead or lookaround

Posted: 2006-11-08, 17:01 UTC
by ghisler(Author)
I'm not aware of any better RegEx library in Delphi. I don't want to use another external dll for now.

Posted: 2006-11-09, 07:19 UTC
by Sosna
pity. but i support it too

Posted: 2006-11-10, 13:44 UTC
by PoV
I understand your wish to avoid relying on a dll, but I found this solution. I don't know if it's a viable solution, but it's certainly worth a look. There's also a wrapper for PCRE usage with Delphi on the same site.

http://www.renatomancuso.com/software/delphi_vbscript/delphi_vbscript.htm

Dead…

Posted: 2006-11-14, 05:35 UTC
by Clo
2ghisler(Author)

:) Good morning,
Total Commander uses the free Delphi library TRegExpr by Andrey V. Sorokin: http://regexpstudio.com/
• This link is dead, I tried several times, nope…

- Please, is there another valid link ? We are updating the Tutorials, and we would like to give a link that works. :?

:mrgreen: VG
Claude
Clo

Posted: 2006-11-14, 05:47 UTC
by Leif

Posted: 2006-11-14, 06:40 UTC
by Stitscher
2Clo
You should read the bug reports more carefully. :lol: :wink:

Stitscher

my 2 cents

Posted: 2006-11-14, 08:07 UTC
by _meta_
regex library:
http://www.regular-expressions.info/delphi.html

you can embedd into exe file...

Forgotten

Posted: 2006-11-14, 09:00 UTC
by Clo
2Stitscher

:) Hello !

:oops: Saw, read but forgotten on the moment !

- I change this and test it, TX.

:mrgreen: VG
Claude
Clo
(Overworked)

Posted: 2006-11-15, 17:07 UTC
by ghisler(Author)
2_meta_
How does it compare to Regexp Studio?