6.20. PCRE-8.12

The PCRE package contains Perl Compatible Regular Expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.

Approximate build time: 0.4 SBU
Required disk space: 12 MB

6.20.1. Installation of PCRE

Prepare PCRE for compilation:

./configure --prefix=/usr \
            --docdir=/usr/share/doc/pcre-8.12 \
            --enable-utf8 \
            --enable-unicode-properties \
            --enable-pcregrep-libz \
            --enable-pcregrep-libbz2

The meaning of the configure options:

--enable-utf8

This switch includes the code for handling UTF-8 character strings in the library.

--enable-unicode-properties

This switch enables Unicode properties support.

--enable-pcregrep-lib*

These switches enable the PCRE library to read files compressed with gzip and bzip2.

Compile the package:

make

To test the results, issue:

make check

Install the package:

make install

The grep binary will be installed in /bin and will link against the PCRE library; as such, move the library to /lib:

mv -v /usr/lib/libpcre.so.* /lib/
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so

6.20.2. Contents of PCRE

Installed programs: pcregrep, pcretest, and pcre-config
Installed libraries: libpcre.{so,a}, libpcrecpp.{so,a} and libpcreposix.{so,a}
Installed directories: /usr/share/doc/pcre-8.12

Short Descriptions

pcregrep

A grep that understands Perl compatible regular expressions.

pcretest

Tests a Perl compatible regular expression.

pcre-config

Used during the compilation process of programs linking to the PCRE libraries.

libpcre

Provides functions useful for working with regular expressions.

libpcrecpp

Provides C++ wrapper functions for the libpcre library.

libpcreposix

Provides wrapper functions based on the POSIX regular expression API.