Registry / serialization / regress

regress

JSON →
library2025.10.1pypypi✓ verified 26d ago

regress provides Python bindings to the high-performance Rust `regress` crate, offering ECMA regular expression capabilities. The library is actively maintained, with its current version being 2025.10.1, and follows a frequent release cadence, as seen with multiple releases throughout 2024 and 2025. It aims to provide a fast and reliable regular expression engine compliant with the ECMA-262 specification.

pip install regress
INSTALL
IMPORT
SIG · REGRESS
R
regress
serializationpythonv2025.10.1
Install
1.6s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2025.10.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Regex
from regress import Regex

This quickstart demonstrates how to initialize a `Regex` object, perform a basic search using `find()`, iterate through all matches with `find_iter()`, and utilize flags for pattern matching.

from regress import Regex # Create a regex object that matches four digits regex = Regex(r"\\d{4}") # Test if the pattern is found in a string match = regex.find("The year is 2024, not 1999.") print(f"Match found: {match is not None}") # Find all occurrences matches = list(regex.find_iter("Years: 1980, 2000, 2020.")) print(f"Number of matches: {len(matches)}") for m in matches: print(f" Match at start: {m.start()}, end: {m.end()}, text: {m.as_str()}") # Another example, with flags (e.g., case-insensitive 'i') # Flags can be passed as a string or a bitmask. regex_flags = Regex(r"hello", "i") print(f"Case-insensitive match: {regex_flags.find('Hello World') is not None}")
Debug
Known issues
breakingThe library transitioned its versioning scheme from a `0.x.x` semantic versioning to a calendar-based `YYYY.MM.PATCH` format (e.g., `2024.8.1`). This major change in version numbering from `0.x` to `2024.x` might indicate breaking API changes, although not explicitly detailed in release notes for the major version bump. Users upgrading from `0.x` versions should review their code for compatibility.
fix
Review the GitHub release notes and `regress` crate documentation for any changes to API methods or behavior, especially if migrating from versions prior to 2024.8.1.
affects: <2024.8.1
gotchaThe `regress` library implements ECMA regular expressions (ECMA-262 standard), which may behave differently from Python's built-in `re` module (which is PCRE-like). Developers accustomed to PCRE syntax might encounter unexpected behavior with certain patterns, lookaheads, or other features not present or differing in ECMA regex.
fix
Familiarize yourself with the ECMA-262 regular expression syntax. Test existing patterns thoroughly when migrating from `re` module usage. Consult the `regress` Rust crate documentation for exact behavior.
affects: All
gotchaAs a Rust-backed Python library using PyO3, `regress` relies on pre-built `manylinux` wheels for easy installation. In environments where compatible wheels are not available (e.g., specific or older Python versions, unusual OS/architecture combinations), installation might fail, requiring users to have a Rust toolchain to compile from source.
fix
Ensure your Python environment is supported by available `manylinux` wheels. If installation fails, install a Rust toolchain (e.g., via `rustup`) and try `pip install regress` again to compile from source.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'regress'
The 'regress' Python package has not been installed in your current Python environment.
fix
pip install regress
AttributeError: module 'regress' has no attribute 'compile'
Unlike Python's built-in 're' module, the 'regress' library typically requires you to instantiate the 'regress.Regress' class directly to compile a regular expression, rather than using a top-level 'compile' function.
fix
import regress
regex_pattern = regress.Regress(r"your_regex_here")
AttributeError: 'regress.Regress' object has no attribute 'search'
The compiled 'regress.Regress' object often provides ECMA-compliant matching methods like 'full_match', 'find_first', or 'find_all' instead of 'search' or 'match' which are common in Python's standard 're' module.
fix
import regress
regex_pattern = regress.Regress(r"your_regex_here")
match_result = regex_pattern.find_first("your_text_here") # Or .full_match(), .find_all()
TypeError: pattern must be a string, not int
The constructor for 'regress.Regress' expects the regular expression pattern to be a string, but a non-string type (e.g., an integer) was provided.
fix
import regress
regex_pattern = regress.Regress(r"\d+") # Ensure the pattern is a string, often a raw string (r"")
Upgrade
Version history
2025.10.1latest on PyPI · released Oct 9, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
regress — pip install regress · libregistry