eselk
eselk

Reputation: 6884

Regular Expression library for Borland Builder 6.0

Is anyone using Boost for regular expressions in BCB6, or can recommend anything else? I've downloaded the latest boost ZIP file a few times, but I can't get it to unzip yet (my PC is probably not in the best state right now). It is a pretty huge library, so if there is anything else smaller that is just regular expressions, that works well with BCB6, I'd like to try that first. I tried http://www.regular-expressions.info/delphi.html also, but it doesn't have any info about BCB support (just Delphi) and it looks like some of the supplied OBJ files have issues with BCB (and no source code to rebuild those).

Edit: After searching the source code and include folders under CBuilder6\ I found out Builder does have built-in support for regex. So another question is, do they work well, and which set of functions/objects should I use for a VCL-based app? I found TRegexp (but no docs for it) and also some PCRE functions under the CRTL help file (but I'd rather use higher level or C++ if all about the same).

Upvotes: 4

Views: 3339

Answers (1)

Ken White
Ken White

Reputation: 125620

The TPerlRegex classes (available at the link you posted above) work fine in C++ Builder. See the section about halfway down the page that refers to older Delphi versions. Best of all, they're free with full Delphi source that will compile in Builder as well.

The components/classes are based on PCRE, and in fact include C source for the .obj files that are used when you compile not to need the DLL, but you can also use it without the .obj files by compiling to require the DLL and distributing the DLL with your app.

The related application to that site, RegexBuddy, can generate strict C-based code for the regexes, or can generate Delphi code (or C++ Builder XE, which can pretty easily be made to work with Builder 6 if you remember that Builder XE is Unicode-based and Builder 6 isn't). (I'm not affiliated with RegexBuddy; I've just been a user since version 1 was released.)

Here's a sample of RegexBuddy 3's C (PCRE) support:

RegexBuddy 3 screen cap

Upvotes: 4

Related Questions