Skip to main content

PECOREGEX

Pecoregex stands for Perl-Compatible Regular Expression, better known as PCRE. Pecoregex is python-pcre's weird little cousin: like python-pcre, pecoregex acts as a bridge between Python and libpcre.

The key differences are:

  • pecoregex relies on ctypes to load and leverage libpcre.so; consequently, it can be installed without compiling anything;

  • pecoregex only provides access to the most essential features of libpcre: compiling and executing regexes (including retrieving captures); other features such as study(), JIT or sub() were not considered (yet?).

Modules

The pecoregex package provides multiple modules:

  • pecoregex.pcre provides PCRE_* constants and the PCRELibrary class; this is the part that actually interacts with libpcre.so; it can be used directly or through the other modules that build upon it;

  • pecoregex.document defines key names for the Pecoregex document format; Pecoregex documents are a way to bundle 1 to n PCRE patterns along with 0 to n subjects each.

  • pecoregex.factory provides helpers to build common Pecoregex documents (e.g. "1 subject, n patterns" documents);

  • pecoregex.util provides functions to process Pecoregex documents, i.e. compile the PCRE patterns they contain and match their associated subject strings against them;

  • pecoregex.cli is typically invoked through the pecoregex CLI tool; it provides a mean to compile and execute PCRE patterns: patterns and subjects are provided either as command-line arguments or by passing a Pecoregex document on the standard input (as JSON or YAML); supported output formats include text, JSON and YAML; therefore, it is perfectly possible to compile and execute multiple PCRE patterns and subjects before picking up their captures using jq.

  • pecoregex.extproc provides simple subprocess-based wrappers that leverage pecoregex.cli to compile and execute PCRE patterns in a separate process; this is meant for all those who consider calling C functions from Python as a threat to the reliability of their program.

License

This Python package and its modules are released under the 3-clause BSD license.

Metadata

Release files for pecoregex 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pecoregex 1.1.0
File Size Uploaded Provenance Actions
pecoregex-1.1.0.tar.gz 13.2 kB Without provenance Details for pecoregex-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pecoregex 1.1.0
File Interpreter ABI Platform Actions
pecoregex-1.1.0-py3-none-any.whl Python 3 none any Details for pecoregex-1.1.0-py3-none-any.whl

Total release size: 29.3 kB

Release files / pecoregex-1.1.0.tar.gz

Download URL pecoregex-1.1.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ec05c5999654292045ca201086ee3a81465121dc6524f3c32d76430eb673818
BLAKE2b-256 checksum
How to use checksums
1c1d63eb83aa8453d12d8b5d016ed5826e3784899f79566b8ef630783245f077
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

Release files / pecoregex-1.1.0-py3-none-any.whl

Download URL pecoregex-1.1.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
680e6c144c7c44fdc97fa8b5b43bc381da75fa08a70c68c3e53f41a63837c8ec
BLAKE2b-256 checksum
How to use checksums
b29988e4360393d54db5ecf9df19497814627377d14430d6e192dab42b74f607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

Security for pecoregex 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page