TrieRegex builds trie-based regular expressions from large word lists, enabling fast string matching against many patterns. Current version 1.0.0 requires Python >=3.6 and is released on PyPI. The library has a stable API with no recent breaking changes.
pip install trieregexVerified import paths — ran on the pinned version, not inferred.
Create a trie from a list of words and compile a regex pattern.
Use trie.capturing_groups() or manually add parentheses around pattern.
Preprocess words with re.escape() before adding them, or use Trie.add() with pre-escaped strings.
Use Trie.regex() instead.