Git Product home page Git Product logo

regenerate's Introduction

Regenerate is a tool to generate test-cases for regular expression engines.

Regenerate takes a regular expression and generates strings that match it. It handles most posix extended regular expressions along with complement (~a) and intersection (a&b). Since it handles complement, it can also generate strings that don't match a given regular expression.

Regenerate is both a tool to generate samples and a library to define test harnesses. There is also an online demo of the tool.

Command line tool

The command line tool can generate example strings matching a given regex. it takes a regex using the POSIX extended regular expression syntax (or ERE for short). For example, here is a set of samples that are matched by the regex (1(01*0)*1|0)* on the alphabet composed of 0 and 1:

% regenerate gen --sample 5 --alphabet "01" "(1(01*0)*1|0)*"
01001
11000
000011
001001
001100
011000
111111
0000110
0011000
0101101
1011101
1101001
00010101
00100100

Please consult the help for more details, or play with the online demo.

Library

The regenerate library allow to easily define test harnesses for regular expression engines. It contains utilities to randomly generate regular expressions and associated positive and negative samples. The main entry point of the library is the Regenerate.arbitrary function which exposes the sample generation as a qcheck generator.

See test_re.ml for an example test harness for re. You can also find (wip) documentation for the dev version of the API.

Website

Code for the online demo is hosted in the web/ directory. It uses fairly simple js_of_ocaml code.

regenerate's People

Contributors

bluddy avatar drup avatar peterthiemann 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.