Home  |  My Software  |  Links
You are here: Home > Software > PCRE Wrapper for Delphi

PCRE Wrapper for Delphi 7

Introduction

PCRE (Perl Compatible Regular Expressions) is a C library written by Philip Hazel of Cambridge University.

PCRE allows C and C++ programs to perform pattern matching using Perl-style regular expressions.

PCRE is written in ANSI C and is extremely portable (I have succesfully compiled and used PCRE under Windows 2000, Windows XP and several 32-bit and 64-bit Unix operating systems).

In order to make PCRE accessible from Delphi I have compiled PCRE as a DLL using MSVC.NET 2003. The C runtime has been statically linked to the DLL to make it completely self contained.

A few modification of the original C sources are needed before PCRE can be accessed by Delphi, mostly to allow access to exported variables that the Delphi linker is not able to import.

In agreement with PCRE licence the modified C sources of my custom version of the PCRE DLL are provided below.

The Delphi Wrapper Classes

Direct access to the PCRE API from a Delphi program is provided by the PCRE_DLL.pas import unit. Directly using the PCRE C API from Delphi is however not for the faint of heart.

For this reason together with the Delphi import unit I am also providing a set of Delphi classes and interfaces that provide an easy to use object-oriented wrapper around the PCRE API.

In addition to ease access to the underlying PCRE API, these wrapper classes also provide some functionality which is missing from the original PCRE API, like the possibilty to find all non-overlapping matches using a single method call, split a string using a regular expression, and search-replace using placeholder variables like in Perl.

The Delphi wrapper classes can be found in the PCRE.pas source file.

Disclaimer


These zip files contain custom versions of PCRE 3.9, PCRE 4.5, PCRE 5.x and PCRE 6.x, and they are neither the original nor a complete distribution of PCRE.
To obtain the original PCRE distribution please go to the original PCRE FTP site at:

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

or visit the pcre.org web site at:

http://www.pcre.org

Downloads

PCRE 6.7 DLL

Win 32 dll + Delphi 7 import unit + Delphi 7 wrapper

format:WinZip size:226 KB last modified:09-Feb-2008

PCRE 6.7 DLL C Sources (with modifications for Delphi)

MSVC .NET 2003 Solution

format:WinZip size:499 KB last modified:27-Nov-2006

PCRE 6.1 DLL

Win 32 dll + Delphi 7 import unit + Delphi 7 wrapper

format:WinZip size:267 KB last modified:27-Aug-2005

PCRE 6.1 DLL C Sources (with modifications for Delphi)

MSVC .NET 2003 Solution

format:WinZip size:461 KB last modified:27-Jun-2005

PCRE 5.0 DLL

Win 32 dll + Delphi 7 import unit + Delphi 7 wrapper

format:WinZip size:206 KB last modified:26-Oct-2004

PCRE 5.0 DLL C Sources (with modifications for Delphi)

MSVC .NET 2003 Solution

format:WinZip size:367 KB last modified:26-Oct-2004

PCRE 4.5 DLL

Win 32 dll + Delphi 7 import unit + Delphi 7 wrapper

format:WinZip size:140 KB last modified:07-Mar-2004

PCRE 4.5 DLL C Sources (with modifications for Delphi)

MSVC .NET 2003 Solution

format:WinZip size:292 KB last modified:11-Jul-2004

PCRE 3.9 DLL

Win 32 dll + Delphi 7 import unit + Delphi 7 wrapper classes

format:WinZip size:189 KB last modified:06-Dec-2003

PCRE 3.9 DLL C Sources (with modifications for Delphi)

MSVC .NET 2002 Solution

format:WinZip size:190 KB last modified:10-Mar-2003