{"categories":[{"label":"Text Processing","url":"https://skillfed.io/packages/category/text-processing/2"}],"enrichment":{"capability":"Parses and manipulates regular expressions by converting them to finite state machines, enabling operations like computing the intersection of two regexes to find strings both accept.","skillfed_tags":["regex-algebra","formal-languages","finite-state-machines"],"use_cases":["Find the common strings accepted by two regex patterns by computing their intersection.","Simplify complex regular expressions using the reduce() method to apply algebraic simplification heuristics.","Reverse a regex pattern to match reversed strings, useful in bidirectional text processing.","Test regex equivalence by comparing two patterns to verify they match exactly the same set of strings.","Generate all strings matched by a regex using the strings() generator, for validation or testing.","Compute the complement of a regex (everythingbut) to match all strings not accepted by the original pattern."],"what_it_does":"Greenery is a library for parsing and manipulating regular expressions at the language level\u2014not for matching strings, but for reasoning about the patterns themselves. It converts regexes to finite state machines internally, allowing you to perform set operations like intersection, union, difference, and complement on regex patterns. The core use case is computing the intersection of two regular expressions: the set of strings that both patterns accept, returned as a new regex.\n\nThe library supports standard regex syntax (character classes, quantifiers, alternation, grouping) but intentionally omits anchors (^ and $), backreferences, and lookahead/lookbehind constructs, since these fall outside formal regular language theory. It provides a Pattern API with methods modeled on frozenset, plus regex-specific operations like reversal, derivation (Brzozowski derivative), and reduction (simplification heuristics). With no external dependencies and a permissive MIT license, it's lightweight and suitable for embedding in tools that need to reason about regex patterns.","worth_installing":"Yes, if you need to reason about regular expressions as formal languages\u2014computing intersections, complements, or equivalences. The library is stable, has no dependencies, and carries a permissive license. However, it is aging (no release since 2024-06-08); install it for a specific regex-algebra task, but do not expect active maintenance or rapid updates."},"id":"greenery","links":{"html":"https://skillfed.io/packages/greenery","md":"https://skillfed.io/packages/greenery.md","pypi":"https://pypi.org/project/greenery/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2024-06-08","license_spdx":null,"license_treatment":"permissive","name":"greenery","python_support":"unspecified","summary":"Greenery allows manipulation of regular expressions"},"popularity":{"monthly_downloads":250525,"position":8627,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"4.2.2"}
