A command-line tool and library that generates regular expressions from user-provided test cases.
grex is a command-line tool and library that automatically generates regular expressions from user-provided test cases. It simplifies regex creation by producing Perl-compatible patterns guaranteed to match the given inputs, reducing manual effort and potential errors. The tool supports features like character class conversion, repetition detection, and Unicode handling.
Developers and data professionals who need to create regular expressions for text processing, validation, or parsing tasks, especially those working with multiple test cases or Unicode text.
grex saves time by automating regex generation while ensuring correctness, offers extensive customization through flags and library options, and supports multiple platforms including CLI, Rust, Python, and WebAssembly for broad usability.
A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates Perl-compatible regex from test cases, saving time and reducing errors, as demonstrated in CLI examples like 'grex a b c' producing '^[a-c]$'.
Fully compliant with Unicode 16.0 and correctly handles multi-symbol graphemes, shown with inputs like 'y̆' which combines Latin Y and Combining Breve.
Available as a CLI tool, Rust library, Python extension, and WebAssembly, making it usable in various environments, as listed in installation methods from cargo to pip.
Offers numerous flags for customization, such as case-insensitive matching, anchor removal, and verbose mode, allowing tailored regex output for different needs.
The algorithm may produce longer or more complex regex than necessary, as admitted in the README where it states that hand-optimization is often required for elegance.
Does not account for built-in optimizations of different regex engines, which can lead to suboptimal performance in targeted applications like high-throughput parsing.
Relies on representative test cases; if inputs are incomplete or biased, the generated regex might be overfitted or incorrect, necessitating manual verification.