--- id: onigurumacffi version: "1.5.0" license: MIT license_treatment: permissive maintenance: active --- # onigurumacffi — python cffi bindings for the oniguruma regex engine License: permissive · Maintenance: active · Downloads: 472.8K/mo ## What it is and what it does onigurumacffi is a thin CFFI wrapper around the Oniguruma regex engine, exposing its pattern matching and searching capabilities to Python. It lets you compile regex patterns and RegSets, then match or search strings with optional position offsets and search flags. The package provides match objects with group extraction, position tracking, and span information. The API is intentionally minimal—it covers core pattern compilation, matching, searching, and capture group access. It's useful when you need Oniguruma's regex dialect or features that Python's built-in re module doesn't offer, but it's not a drop-in replacement for the standard library. The package requires Python 3.10+ and depends only on cffi; wheels are available for most platforms, though source builds need libonig-dev. Use it for: - Use it when you need Oniguruma's specific regex syntax or features not available in Python's built-in re module. - Use it to compile and reuse complex regex patterns for high-throughput string matching in text processing pipelines. - Use it to search multiple patterns simultaneously via RegSet for efficient multi-pattern matching. - Use it in syntax highlighters or code analysis tools that rely on Oniguruma's regex dialect. - Use it when integrating with systems or libraries that already use Oniguruma and need consistent regex behavior. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python bindings to the Oniguruma regex engine via CFFI, enabling pattern matching and searching with Oniguruma's regex features. Yes, if you specifically need Oniguruma's regex features or dialect. The package is actively maintained, has no known vulnerabilities, and is permissively licensed. Install friction is moderate due to compiled bindings but wheels are available for common platforms. If you're looking for a general-purpose regex library, Python's built-in re module is simpler; install this only if Oniguruma's specific capabilities are required. ## Install pip install onigurumacffi uv add onigurumacffi poetry add onigurumacffi ## Installing onigurumacffi Before you install: Medium install friction due to compiled CFFI bindings; wheels are available for common platforms (macOS arm64/x86_64, Linux x86_64, Windows 32/64-bit, PyPy) but source builds require libonig-dev. Package is actively maintained with recent commits and no known vulnerabilities. License in practice: MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install onigurumacffi import onigurumacffi pattern = onigurumacffi.compile(r'\w+') match = pattern.search('test string') if match: print(match.group(0)) Source builds require libonig-dev to be installed before pip install; prebuilt wheels are available for most platforms. Verify before relying: - Whether the API's current limited scope covers your specific regex use case. - Performance characteristics compared to Python's built-in re module or other regex engines. - Compatibility with specific Oniguruma regex features you plan to rely on. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 472.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags oniguruma regex python, cffi regex bindings, advanced pattern matching, oniguruma engine bindings, regex search library, pattern compilation, regex engine wrapper, regex-engine, cffi-binding, pattern-matching [View on SkillFed](https://skillfed.io/packages/onigurumacffi) · [View on PyPI](https://pypi.org/project/onigurumacffi/)