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
). See
the help for details.
Since it handles complement, it can also generate strings that
don't match a given regular expression.
Below, we generate both positive and negative examples for the
language composed of the letter 'a' and 'b'.
See our paper for details.
Regenerate is made with OCaml and a couple of cool OCaml libraries. The native tool and the library are available on opam. This page was made with the awesome js_of_ocaml compiler. The source code is available on github.
You can use most posix extended regular expressions plus complement and intersection. More precisely:
a
: A single char.[ab]
: Character sets.
[^ab]
: Complement Character sets.[a-c]
: Character ranges.ab
: Sequence.a|b
: Alternative.a&b
: Intersection.~a
: Complement.a{i,j}
: Repetition.
a*
is a{0,}
a+
is a{1,}
a?
is a{0,1}
Back references, character classes, anchoring and lookahead/lookbehind are not supported.