{"categories":[{"label":"Text Processing","url":"https://skillfed.io/packages/category/text-processing/3"}],"enrichment":{"capability":"Matches multiple regex patterns against a string efficiently by using prematchers to filter candidates before full regex evaluation, delivering 2-10x speedups over na\u00efve regex matching.","skillfed_tags":["regex-optimization","pattern-matching","performance"],"use_cases":["Scan log files or text streams for multiple error/warning patterns without running each regex separately","Extract multiple entity types (emails, URLs, phone numbers) from documents in a single pass","Validate input against a ruleset of regex constraints where most rules will not match most inputs","Build content filters that check text against many blocked-pattern rules efficiently","Implement multi-pattern search in text editors or code analysis tools"],"what_it_does":"multiregex is a pattern-matching library that accelerates searching for multiple regex patterns in a single string. Instead of running each regex independently, it uses \"prematchers\"\u2014fast substring checks that predict whether a full regex is likely to match\u2014to skip expensive regex evaluation on non-matching candidates. The library provides three matching modes (search, match, fullmatch) that mirror Python's standard re module, returning sets of (Pattern, Match) tuples for all patterns that matched.\n\nThe speedup comes from filtering: prematchers are lists of literal strings that must be present if a regex matches, so multiregex checks for these substrings first and only evaluates the full regex on promising candidates. For simple patterns like r\"\\w+\\.com\", prematchers are generated automatically; for complex patterns, you supply your own or disable prematching entirely. The library includes a profiler to measure prematcher effectiveness and identify false positives.","worth_installing":"Yes. Low install friction, active maintenance, no security issues, and a clear performance win for the specific problem it solves (matching many regexes). The permissive BSD-3-Clause license poses no restrictions. Worth installing if you routinely match multiple patterns against strings; not necessary for single-pattern matching or if your patterns are already optimized."},"id":"multiregex","links":{"html":"https://skillfed.io/packages/multiregex","md":"https://skillfed.io/packages/multiregex.md","pypi":"https://pypi.org/project/multiregex/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-20","license_spdx":"BSD-3-Clause","license_treatment":"permissive","name":"multiregex","python_support":"supports_current","summary":"Quickly match many regexes against a string. Provides 2-10x speedups over na\u00efve regex matching."},"popularity":{"monthly_downloads":79338,"position":14364,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.0.4"}
