Onigurumacffi provides Python cffi bindings for the Oniguruma regex engine. Currently at version 1.5.0, it wraps the Oniguruma C library, offering a performant, multibyte-aware regex engine that operates primarily on bytes, distinct from Python's built-in `re` module. The library bundles the Oniguruma C source, simplifying installation, and requires Python 3.10 or newer. Releases are infrequent, tied to updates in the underlying Oniguruma library or CFFI.
pip install onigurumacffiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `OnigurumaRegex` with a byte pattern and encoding, perform `match` and `search` operations on byte strings, and access matched groups. It also includes basic error handling for invalid regex patterns.
Always refer to Oniguruma's official documentation for pattern syntax and behavior. Do not assume `re` module compatibility.
Check the `onigurumacffi` GitHub README for the bundled Oniguruma version. For newer versions, monitor `onigurumacffi` releases or consider custom compilation.
Ensure all patterns and input strings are encoded to `bytes` (e.g., `b'pattern'` or `'string'.encode('utf-8')`) before passing them to `onigurumacffi` functions. Decode results (e.g., `match.group(1).decode('utf-8')`) for string output.No dependency data recorded yet.