grex is a library as well as a command-line utility that is meant to simplify the often complicated and tedious task of creating regular expressions. It does so by automatically generating a single regular expression from user-provided test cases. The resulting expression is guaranteed to match the test cases which it was generated from. This project has started as a Rust port of the JavaScript tool regexgen written by Devon Govett. Although a lot of further useful features could be added to it, its development was apparently ceased several years ago. The plan is now to add these new features to grex as Rust really shines when it comes to command-line tools. grex offers all features that regexgen provides, and more. The philosophy of this project is to generate the most specific regular expression possible by default that exactly matches the given input only and nothing else. With the use of command-line flags (in the CLI tool) or preprocessing methods (in the library).

Features

  • Detection of common prefixes and suffixes
  • Detection of repeated substrings and conversion to {min,max} quantifier notation
  • Alternation using | operator
  • Fully compliant to newest Unicode Standard 13.0
  • Capturing or non-capturing groups
  • Reads input strings from the command-line or from a file

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow grex

grex Web Site

Other Useful Business Software
Get full visibility and control over your tasks and projects with Wrike. Icon
Get full visibility and control over your tasks and projects with Wrike.

A cloud-based collaboration, work management, and project management software

Wrike offers world-class features that empower cross-functional, distributed, or growing teams take their projects from the initial request stage all the way to tracking work progress and reporting results.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of grex!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Rust

Related Categories

Rust Terminals, Rust Command Line Tools

Registered

2022-05-13