PCRE - Perl Compatible Regular Expressions

The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API. The PCRE library is free, even for building proprietary software.

PCRE was originally written for the Exim MTA, but is now used by many high-profile open source projects, including Apache, PHP, KDE, Postfix, and Nmap. PCRE has also found its way into some well known commercial products, like Apple Safari. Some other interesting projects using PCRE include Chicken, Onyx, Hypermail, Leafnode, Askemos, Wenlin, and 8th.

Versions

There are two major versions of the PCRE library. The current version, PCRE2, released in 2015, is now at version 10.44.

The older, but still widely deployed PCRE library, originally released in 1997, is at version 8.45. This version of PCRE is now at end of life, and is no longer being actively maintained. Version 8.45 is expected to be the final release of the older PCRE library, and new projects should use PCRE2 instead.

Download

You can download the current release of the PCRE2 library from its official home on GitHub:

You can also download the older, unmaintained PCRE library from an unofficial mirror at SourceForge:

You can check out the PCRE2 source code via Git:

git clone https://github.com/PCRE2Project/pcre2.git

Note that the former ftp.pcre.org FTP site is no longer available, and that PCRE2 releases will no longer be kept up to date on SourceForge. Any scripts that download PCRE source code should use HTTPS or Git from GitHub.

Contributed Ports

If you just need the command-line PCRE or PCRE2 tools on Windows, precompiled binary versions are available at this Rexegg page.

A PCRE2 port for z/OS, a mainframe operating system which uses EBCDIC as its default character encoding, can be found at http://www.cbttape.org/ (File 939).

Documentation

You can read PCRE2 HTML documentation, or the text version of the PCRE2 man pages. For Perl 5 regular expression syntax, read the Perl regular expressions man page.

The distribution itself also contains a README and the BSD LICENCE. If you are upgrading, read the NEWS and ChangeLog files.

You can also browse the older PCRE HTML documentation, text version of the older PCRE man pages, and the original README or and the original ChangeLog files.

Details on PCRE, and, in particular, comparisons to Perl's regular expression semantics, can also be found in the community authored Wikipedia entry on PCRE.

There is a curated summary of changes with each PCRE release, copies of documentation from older releases, and other useful information from the third party authored RexEgg PCRE Documentation and Change Log page.

Contact

To report a problem with the PCRE2 library, or to make a feature request, please visit the PCRE GitHub issues tracker. Note that bugs in the legacy PCRE release are unlikely to be looked at or fixed; and please don't use the SourceForge bug tracking system, as it is not normally monitored.

There is a mailing list for active PCRE developers at pcre2-dev@googlegroups.com, and you can browse the list archives. For a limited time you may also be able to browse the archives of the historical pcre-dev@exim.org list as well.

The PCRE library was written by Philip Hazel:

E-mail local part: Philip.Hazel
E-mail domain: gmail.com

Please note that neither this website nor the SourceForge download repositories are maintained by Philip. Please report website or SourceForge PCRE project problems to webmaster@pcre.org.



webmaster@pcre.org