skillfed

rebulk

Rebulk - Define simple search patterns in bulk to perform advanced matching on any string.

rebulk v6.0.1 151.4K downloads/30d#10,935 on PyPI60
Permissive license MIT Active released

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 rebulk

uv

uv add rebulk

poetry

poetry add rebulk

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules

Tags

advanced string pattern matchingregex alternative fluent apicomplex string search librarypattern matching bulk operationsstring matching with rulesregex wrapper readable apioverlapping match resolution
pattern-matchingstring-parsingfluent-api

More Python Modules packages