Time to switch to a more standard regexp engine ?

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

PoV
Junior Member
Junior Member
Posts: 9
Joined: 2003-10-16, 12:35 UTC
Location: Paris, France

Time to switch to a more standard regexp engine ?

Post 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'.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

Total Commander Help wrote:Total Commander uses the free Delphi library TRegExpr by Andrey V. Sorokin: http://regexpstudio.com/
I switched to Linux, bye and thanks for all the fish!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post 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.
Habemus majkam!
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post 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
This account is for sale
User avatar
WatchUer
Senior Member
Senior Member
Posts: 243
Joined: 2003-02-22, 10:46 UTC
Location: China

Post by *WatchUer »

Support!!!
User avatar
solid
Power Member
Power Member
Posts: 749
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

Defenitely support.
Current regex library doesn't support positive or negative lookahead or lookaround
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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.
Author of Total Commander
https://www.ghisler.com
User avatar
Sosna
Member
Member
Posts: 143
Joined: 2006-10-24, 10:52 UTC

Post by *Sosna »

pity. but i support it too
Ave Caesar Imperator,
moritari te salutant!
PoV
Junior Member
Junior Member
Posts: 9
Joined: 2003-10-16, 12:35 UTC
Location: Paris, France

Post 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
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Dead…

Post 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
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Leif
Senior Member
Senior Member
Posts: 328
Joined: 2003-02-05, 15:44 UTC
Location: Umeå, Sweden

Post by *Leif »

Get Radio? Sure! - the best Internet Radio Player ever! ;)
User avatar
Stitscher
Power Member
Power Member
Posts: 1058
Joined: 2004-02-17, 12:34 UTC
Location: Hamburg, Germany

Post by *Stitscher »

2Clo
You should read the bug reports more carefully. :lol: :wink:

Stitscher
_meta_
Junior Member
Junior Member
Posts: 34
Joined: 2006-11-14, 08:04 UTC

my 2 cents

Post by *_meta_ »

regex library:
http://www.regular-expressions.info/delphi.html

you can embedd into exe file...
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Forgotten

Post by *Clo »

2Stitscher

:) Hello !

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

- I change this and test it, TX.

:mrgreen: VG
Claude
Clo
(Overworked)
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2_meta_
How does it compare to Regexp Studio?
Author of Total Commander
https://www.ghisler.com
Post Reply