rebulk
Rebulk - Define simple search patterns in bulk to perform advanced matching on any string.
What it is and what it does
ReBulk is a Python library that simplifies complex string searching by providing a readable, chainable API for defining patterns. Instead of writing intricate regex or string manipulation code, you declare patterns using string(), regex(), functional(), and chain() methods on a Rebulk object, then call matches() to find all occurrences. When multiple patterns match at the same position, ReBulk keeps only the longest match, eliminating the need to manually resolve conflicts.
The library is built for tasks where the standard re module or string methods become unwieldy—parsing structured text formats, extracting metadata from filenames, or validating complex patterns. It supports validators and formatters to filter or transform matches, pre- and post-processors to modify match objects, and chain patterns for ordered composition of multiple pattern types. With no external runtime dependencies and support for modern Python versions, it integrates cleanly into existing projects.
Use it for:
- Parse structured filenames or paths to extract metadata like episode numbers, versions, or quality indicators
- Build a custom text parser for domain-specific formats (e.g., log entries, configuration files) without writing complex regex
- Validate and extract multiple overlapping patterns from a single string, automatically choosing the longest match
- Chain multiple pattern types together to match sequences (e.g., 'episode number followed by optional version followed by zero or more extra identifiers')
- Apply custom validation logic to matched patterns using validator functions before accepting them as results
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ReBulk provides a fluent API for building complex string pattern matchers using regex, string, and functional patterns, with automatic conflict resolution when multiple matches overlap.
Yes. ReBulk is actively maintained, has no dependencies, supports current Python versions, carries an MIT license, and solves a real problem—making complex string matching readable and maintainable. Install it if you're building a text parser or pattern extractor where regex alone becomes hard to follow or maintain.
Install
rebulk on PyPI
pip
pip install rebulkuv
uv add rebulkpoetry
poetry add rebulkInstalling rebulk
Before you install
Low friction install with no runtime dependencies. Actively maintained with a recent release; supports current Python versions (3.10 through 3.14).
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Quickstart
from rebulk import Rebulk
bulk = Rebulk().string('brown').regex(r'qu\w+').functional(lambda s: (20, 25))
matches = bulk.matches("The quick brown fox jumps over the lazy dog")
print(matches) # [<brown:(10, 15)>, <quick:(4, 9)>, <jumps:(20, 25)>]
Verify before relying
- Whether the optional regex module integration (REBULK_REGEX_ENABLED=1) provides material performance or feature benefits over the standard library re module
- Real-world performance characteristics when matching against very large strings or with deeply nested chain patterns
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 151,390/month — #10,935 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rebulk-6.0.1-py3-none-any.whl
Keywords: re, regexp, regular expression, search, pattern, string, match
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
hyperscanPython bindings for Vectorscan (an open-source…
permissive · top 15,000 on PyPI
retrieBuilds efficient Trie-based regex patterns for…
permissive · top 15,000 on PyPI
multiregexMatches multiple regex patterns against a…
permissive · top 15,000 on PyPI
regexA drop-in replacement for Python's standard…
permissive · top 100 on PyPI
interegularInteregular checks whether pairs of Python…
permissive · top 5,000 on PyPI
ahocorasick-rsSearches for multiple substrings in text or…
permissive · top 15,000 on PyPI
flpcflpc wraps the Rust regex crate to provide…
permissive · top 5,000 on PyPI
pygrokParses strings and extracts structured data…
permissive · top 15,000 on PyPI
exrexExrex generates all or random strings matching…
agpl · top 15,000 on PyPI
onigurumacffiProvides Python bindings to the Oniguruma regex…
permissive · top 15,000 on PyPI