Try Microsoft Edge
A fast and secure browser that's designed for Windows 10
Get started
Rex is a tool that explores .NET regexes and generates members efficiently.
The duel mode is a game where you have to guess a secret (hidden) regex. On each attempt, Rex generates strings that match or don’t match the same way as the secret regex. The game uses the ASCII range of characters, i.e. characters from code 0 to 127 and displays various automata associated to the regexes.

There is a secret regex S and a given regex R. When you ask rex, a table is displayed showing (up to two) members of
where L(r) denotes the set of all strings matching a regex r. In addition, the following automata are shown for R:
All automata are displayed in symbolic or extended form, meaning that the labels on the transitions denote (nonempty) sets of characters rather than individual characters.
The duel also displays an NFA accepting L(S) minus L(R), denoted by NFA(S-R).
Duels uses features of the underlying automata library (used by Rex) such as:
You have created your own duel!
Enter regexes R and S (note that comments can be added to regexes) and click permalink:

This particular example is the link http://www.rise4fun.com/Rex/abG.When you visit the link, only R is shown, S remains secret:
When you now ask rex, the following results are shown:
Most regex constructs are explained in .NET regexes.
Regarding character classes, a less known but useful construct is subtraction operation in character classes:
When writing regexes, you can insert comments, e.g., to provide a hint in the given regex in the duel, for solving the secret regex
Rex is a simple command line tool that takes a .NET regex pattern or several regex patterns and generates matching string(s) for them. Rex can also be used through an API. Rex is fast, using a novel approach to solve this problem. When several regexes are provided, rex can be used to generate members that match all the regexes. By default, rex assumes UTF16 encoding of characters, but can also be restricted to ASCII ecoding.
The following example generates 10 strings that start and end with a digit and have at least two characters:
> rex.exe "^d.*d$" /k:10
In order to produce members that contain only ascii characters the /e option can be used. For general instructions regarding usage run:
> rex.exe /?
1) A regex pattern (or several patterns) is translated into a symbolic finite automaton
^[0-9]+|[a-z]$ ==> 
2) The automaton is given to a constraint solver that generates members from it.

Try out Pex on the web!
Senior Researcher
Principal RSDE