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
Deploy Apps in Seconds with Cloud Run Icon
Deploy Apps in Seconds with Cloud Run

Host and run your applications without the need to manage infrastructure. Scales up from and down to zero automatically.

Cloud Run is the fastest way to deploy containerized apps. Push your code in Go, Python, Node.js, Java, or any language and Cloud Run builds and deploys it automatically. Get fast autoscaling, pay only when your code runs, and skip the infrastructure headaches. Two million requests free per month. And new customers get $300 in free credit.
Try Cloud Run Free
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