{"id":2260,"library":"regress","title":"Python bindings to Rust's regress ECMA regular expressions library","description":"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.","status":"active","version":"2025.10.1","language":"en","source_language":"en","source_url":"https://github.com/crate-py/regress","tags":["regular expressions","regex","rust","bindings","ecma"],"install":[{"cmd":"pip install regress","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"Regex","correct":"from regress import Regex"}],"quickstart":{"code":"from regress import Regex\n\n# Create a regex object that matches four digits\nregex = Regex(r\"\\\\d{4}\")\n\n# Test if the pattern is found in a string\nmatch = regex.find(\"The year is 2024, not 1999.\")\nprint(f\"Match found: {match is not None}\")\n\n# Find all occurrences\nmatches = list(regex.find_iter(\"Years: 1980, 2000, 2020.\"))\nprint(f\"Number of matches: {len(matches)}\")\nfor m in matches:\n    print(f\"  Match at start: {m.start()}, end: {m.end()}, text: {m.as_str()}\")\n\n# Another example, with flags (e.g., case-insensitive 'i')\n# Flags can be passed as a string or a bitmask.\nregex_flags = Regex(r\"hello\", \"i\")\nprint(f\"Case-insensitive match: {regex_flags.find('Hello World') is not None}\")","lang":"python","description":"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."},"warnings":[{"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.","message":"The 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.","severity":"breaking","affected_versions":"<2024.8.1"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All"},{"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.","message":"As 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}