Regex Support Added to The RTL in Delphi XE and C++Builder XE
Delphi XE and C++Builder XE will ship with regular expression support built right into the runtime library. The RegularExpressions unit is based on code originally written by Vincent Parrett. It implements a set of classes (records, actually) that mimics the regex classes in the .NET framework. That includes the whole set of convenient static methods as well as automatic cleanup when the record goes out of scope.
The RegularExpressions unit uses the RegularExpressionsCore unit to do the heavy lifting. The RegularExpressionsCore unit is a modified version of the PerlRegEx unit developed by yours truly. This unit defines a single Delphi class called TPerlRegEx that wraps the functionality of the PCRE open source library, with added methods for replacing and splitting. You can use the RegularExpressionsCore unit directly, just as you can already use the PerlRegEx unit in older versions of Delphi.
Vincent and I donated copies of our code to Embarcadero. We keep the full rights to our code, while Embarcadero gets full rights to their copy. That means I can continue to distribute TPerlRegEx for older versions of Delphi. I’ll release a new version of TPerlRegEx that includes some changes I made prior to donating the code to Embarcadero.
I’ll blog about these two units with more technical details once RAD Studio XE ships. The next free minor updates of RegexBuddy and RegexMagic will support Delphi XE and X++Builder XE using these new units, while retaining support for TPerlRegEx for older versions of Delphi.