PCRE - Perl Compatible Regular Expressions

Links: Homepage
Dependencies: None
Version: 8.33

The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.

Get the Code

Switch to /usr/local/src and download the source package.

cd /usr/local/src
curl --remote-name ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-VERSION.tar.gz

Extract the archive and move into the folder.

tar -xzvf pcre-VERSION.tar.gz
cd pcre-VERSION

Compile and Install

Configure, compile and install into /usr/local/pcre-VERSION.

./configure --prefix=/usr/local/pcre-VERSION
make
make install

Create a symbolic link that points /usr/local/pcre to /usr/local/pcre-VERSION.

ln -s pcre-VERSION /usr/local/pcre

Shell

Execute the following lines to update your Bash startup script.

echo 'export PATH=/usr/local/pcre/bin:$PATH' >> ~/.bash_profile

Load the new shell configurations.

source ~/.bash_profile

Verify the Installation

To verify that you have correctly installed PCRE, execute the following command. It should display VERSION.

pcre-config --version