Code Monkey home page Code Monkey logo

grex's Introduction

grex

Build Status codecov Crates.io license

grex is a small command-line utility that is meant to simplify the often complicated and tedious task of creating regular expressions. It does so by automatically generating regular expressions from user-provided input strings that match the generated expression.

In its very early stage, this tool is a Rust port of regexgen which has been implemented in JavaScript and runs in a Node.js environment. The plan is, however, to add much more functionality to grex than regexgen provides. The development of the latter was ceased more than two years ago. Compared to regexgen, grex is currently lacking support for character classes. This feature will be added in the next version.

Features

  • literals
  • detection of common prefixes and suffixes
  • alternation using | operator
  • repetition using ? quantifier
  • concatenation of all of the former

How to use

$ grex -h
grex 0.1.0
Peter M. Stahl <[email protected]>
grex generates regular expressions that match user-provided input strings.

USAGE:
    grex <input>...

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <input>... 

Some examples

$ grex abc def
abc|def

$ grex a ab abc
a(bc?)?

$ grex thankful thoughtful
th(ought|ank)ful

$ grex 2.0-3.5 2.5-6.0
2\.(0\-3\.5|5\-6\.0)

grex's People

Contributors

pemistahl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.