HomeBlogSharewareFreewareDownloadsEditorialsArticlesStuffAbout

Regex Library

Download

Download full source code for the Regular Expression Library: niRegularExpression12.zip - 314KB

The archive includes all source code for the Regular Expression Library, including my own unit tests.

System Requirements

Delphi Version: Any Win32 edition of Delphi from v5 up

The Regular Expression library was originally developed with Delphi 5. It has been tested with Delphi 6 and is currently maintained with Delphi 7. I know of no reason why there should be any problem working with more recent Win32 editions such as Delphi 2005 or Delphi 2006.

Operating System: Any version of Windows from 95 up.

Licensing

This library is shareware - after a reasonable period of evalutation, you are expected to either register the library or remove it from your system.

Overview of Regex Library

As anyone familiar with the unix commandline tool grep will attest, Regular Expressions are a powerful and convenient way to recognise patterns in text.

When I had a need for Regular Expression handling in a project, I found a lack of suitable tools. The theory behind Regular Expressions is all about finite state machines and graph theory, an area superbly suited for an object oriented implementation. Yet, none of the tools I could find had a native Delphi orientation, let alone an Object Oriented implementation.

The tool sets I did find fell into one of the following categories:

  • Source code for languages I'm unfamiliar with;
  • Wrapper objects around a DLL;
  • Code translated to Delphi from other languages;

This last category had some interesting candidates - including (I kid you not) a Direct transliteration into Delphi of the C++ reimplementation of a C library function (this was kinda fun to read, even though completely useless to me!)

Finally, I decided to write my own library, from first principles, making use of the OO nature of the problem to come up with an efficient, effective and maintainable library for handling Regular Expressions.

The current version is 1.2 - I have used the library extensively in my own code (albeit for simple expressions), so it is now ready for others to have a go. Please email me with any thoughts you have, bugs found or bugs fixed.