Skip to content

Hyperscan for Python

python-hyperscan is an unofficial CPython extension for Intel's Hyperscan, the open source, high-performance multiple regex matching library.


Building Hyperscan

See the official documentation for detailed installation instructions and dependencies.

The following should work for most use cases, once the prerequisite dependencies have been installed:

$ git clone
$ mkdir -p hyperscan/build
$ cd hyperscan
$ # PCRE1 (8.xx series) is required for Chimera support
$ wget -qO- | tar xvz
$ git checkout v5.4.0
    -DPCRE_SOURCE=../pcre-8.45 \
$ # Compile with all available cores:
$ # make -j $(( $(nproc) + 1 ))
$ make
$ sudo make install

Note: if you are building v5.4.0 and encounter undefined reference errors when linking, see intel/hyperscan#292 (and more specifically, this comment) for the fix. Per the maintainers, this will be fixed in the next Hyperscan release.

Installing python-hyperscan

Installing via pip is recommended:

$ pip install hyperscan

To build and install from source, using Poetry:

$ pip install poetry==1.4.2
$ git clone
$ cd python-hyperscan
$ poetry install