Skip to main content

RE2 Python bindings

Project description

A drop-in replacement for the re module.

It uses RE2 under the hood, of course, so various PCRE features
(e.g. backreferences, look-around assertions) are not supported.
See https://github.com/google/re2/wiki/Syntax for the canonical
reference, but known syntactic "gotchas" relative to Python are:

* PCRE supports \Z and \z; RE2 supports \z; Python supports \z,
but calls it \Z. You must rewrite \Z to \z in pattern strings.

Known differences between this module's API and the re module's API:

* The error class does not provide any error information as attributes.
* The Options class replaces the re module's flags with RE2's options as
gettable/settable properties. Please see re2.h for their documentation.
* The pattern string and the input string do not have to be the same type.
Any str will be encoded to UTF-8.
* The pattern string cannot be str if the options specify Latin-1 encoding.

Known issues with regard to building the C++ extension:

* Building requires RE2 to be installed on your system.
On Debian, for example, install the libre2-dev package.
* Building requires pybind11 to be installed on your system OR venv.
On Debian, for example, install the pybind11-dev package.
For a venv, install the pybind11 package from PyPI.
* Building on macOS is known to work, but has been known to fail.
For example, the system Python may not know which compiler flags
to set when building bindings for software installed by Homebrew;
see https://docs.brew.sh/Homebrew-and-Python#brewed-python-modules.
* Building on Windows has not been tested yet and will probably fail.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_re2-1.1.20240701.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distributions

google_re2-1.1.20240701-1-cp312-cp312-win_amd64.whl (497.2 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

google_re2-1.1.20240701-1-cp312-cp312-win32.whl (422.0 kB view hashes)

Uploaded CPython 3.12 Windows x86

google_re2-1.1.20240701-1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (547.1 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

google_re2-1.1.20240701-1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (538.3 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

google_re2-1.1.20240701-1-cp312-cp312-macosx_14_0_x86_64.whl (491.6 kB view hashes)

Uploaded CPython 3.12 macOS 14.0+ x86-64

google_re2-1.1.20240701-1-cp312-cp312-macosx_14_0_arm64.whl (461.4 kB view hashes)

Uploaded CPython 3.12 macOS 14.0+ ARM64

google_re2-1.1.20240701-1-cp312-cp312-macosx_13_0_x86_64.whl (491.6 kB view hashes)

Uploaded CPython 3.12 macOS 13.0+ x86-64

google_re2-1.1.20240701-1-cp312-cp312-macosx_13_0_arm64.whl (461.4 kB view hashes)

Uploaded CPython 3.12 macOS 13.0+ ARM64

google_re2-1.1.20240701-1-cp312-cp312-macosx_12_0_x86_64.whl (491.5 kB view hashes)

Uploaded CPython 3.12 macOS 12.0+ x86-64

google_re2-1.1.20240701-1-cp312-cp312-macosx_12_0_arm64.whl (465.7 kB view hashes)

Uploaded CPython 3.12 macOS 12.0+ ARM64

google_re2-1.1.20240701-1-cp311-cp311-win_amd64.whl (496.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

google_re2-1.1.20240701-1-cp311-cp311-win32.whl (421.5 kB view hashes)

Uploaded CPython 3.11 Windows x86

google_re2-1.1.20240701-1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (548.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

google_re2-1.1.20240701-1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (541.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

google_re2-1.1.20240701-1-cp311-cp311-macosx_14_0_x86_64.whl (488.6 kB view hashes)

Uploaded CPython 3.11 macOS 14.0+ x86-64

google_re2-1.1.20240701-1-cp311-cp311-macosx_14_0_arm64.whl (460.0 kB view hashes)

Uploaded CPython 3.11 macOS 14.0+ ARM64

google_re2-1.1.20240701-1-cp311-cp311-macosx_13_0_x86_64.whl (488.6 kB view hashes)

Uploaded CPython 3.11 macOS 13.0+ x86-64

google_re2-1.1.20240701-1-cp311-cp311-macosx_13_0_arm64.whl (460.0 kB view hashes)

Uploaded CPython 3.11 macOS 13.0+ ARM64

google_re2-1.1.20240701-1-cp311-cp311-macosx_12_0_x86_64.whl (490.4 kB view hashes)

Uploaded CPython 3.11 macOS 12.0+ x86-64

google_re2-1.1.20240701-1-cp311-cp311-macosx_12_0_arm64.whl (465.9 kB view hashes)

Uploaded CPython 3.11 macOS 12.0+ ARM64

google_re2-1.1.20240701-1-cp310-cp310-win_amd64.whl (495.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

google_re2-1.1.20240701-1-cp310-cp310-win32.whl (420.2 kB view hashes)

Uploaded CPython 3.10 Windows x86

google_re2-1.1.20240701-1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (547.0 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

google_re2-1.1.20240701-1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (539.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

google_re2-1.1.20240701-1-cp310-cp310-macosx_14_0_x86_64.whl (487.3 kB view hashes)

Uploaded CPython 3.10 macOS 14.0+ x86-64

google_re2-1.1.20240701-1-cp310-cp310-macosx_14_0_arm64.whl (459.2 kB view hashes)

Uploaded CPython 3.10 macOS 14.0+ ARM64

google_re2-1.1.20240701-1-cp310-cp310-macosx_13_0_x86_64.whl (487.3 kB view hashes)

Uploaded CPython 3.10 macOS 13.0+ x86-64

google_re2-1.1.20240701-1-cp310-cp310-macosx_13_0_arm64.whl (459.2 kB view hashes)

Uploaded CPython 3.10 macOS 13.0+ ARM64

google_re2-1.1.20240701-1-cp310-cp310-macosx_12_0_x86_64.whl (488.8 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

google_re2-1.1.20240701-1-cp310-cp310-macosx_12_0_arm64.whl (464.4 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ ARM64

google_re2-1.1.20240701-1-cp39-cp39-win_amd64.whl (496.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

google_re2-1.1.20240701-1-cp39-cp39-win32.whl (420.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

google_re2-1.1.20240701-1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (547.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

google_re2-1.1.20240701-1-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (539.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

google_re2-1.1.20240701-1-cp39-cp39-macosx_14_0_x86_64.whl (487.4 kB view hashes)

Uploaded CPython 3.9 macOS 14.0+ x86-64

google_re2-1.1.20240701-1-cp39-cp39-macosx_14_0_arm64.whl (459.3 kB view hashes)

Uploaded CPython 3.9 macOS 14.0+ ARM64

google_re2-1.1.20240701-1-cp39-cp39-macosx_13_0_x86_64.whl (487.4 kB view hashes)

Uploaded CPython 3.9 macOS 13.0+ x86-64

google_re2-1.1.20240701-1-cp39-cp39-macosx_13_0_arm64.whl (459.3 kB view hashes)

Uploaded CPython 3.9 macOS 13.0+ ARM64

google_re2-1.1.20240701-1-cp39-cp39-macosx_12_0_x86_64.whl (488.9 kB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

google_re2-1.1.20240701-1-cp39-cp39-macosx_12_0_arm64.whl (464.6 kB view hashes)

Uploaded CPython 3.9 macOS 12.0+ ARM64

google_re2-1.1.20240701-1-cp38-cp38-win_amd64.whl (516.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

google_re2-1.1.20240701-1-cp38-cp38-win32.whl (420.8 kB view hashes)

Uploaded CPython 3.8 Windows x86

google_re2-1.1.20240701-1-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (546.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

google_re2-1.1.20240701-1-cp38-cp38-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (538.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

google_re2-1.1.20240701-1-cp38-cp38-macosx_14_0_x86_64.whl (487.3 kB view hashes)

Uploaded CPython 3.8 macOS 14.0+ x86-64

google_re2-1.1.20240701-1-cp38-cp38-macosx_14_0_arm64.whl (459.0 kB view hashes)

Uploaded CPython 3.8 macOS 14.0+ ARM64

google_re2-1.1.20240701-1-cp38-cp38-macosx_13_0_x86_64.whl (487.3 kB view hashes)

Uploaded CPython 3.8 macOS 13.0+ x86-64

google_re2-1.1.20240701-1-cp38-cp38-macosx_13_0_arm64.whl (459.0 kB view hashes)

Uploaded CPython 3.8 macOS 13.0+ ARM64

google_re2-1.1.20240701-1-cp38-cp38-macosx_12_0_x86_64.whl (488.7 kB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

google_re2-1.1.20240701-1-cp38-cp38-macosx_12_0_arm64.whl (464.4 kB view hashes)

Uploaded CPython 3.8 macOS 12.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page