Not the police dog – Rex is a utility developed by Microsoft Research that generates strings matching a given regular expression. Results can be saved to a file for easy use. Here is an example:
Shell
> rex.exe "^[a-z]+$" /k:10 /file:toto.txt
/k:10 generates 10 results/file:toto.txt saves results to a file
Here are the generated strings:
d
ux
gxh
k
lo
ze
m
jvl
u
som
Rex is very handy for generating test data. Since it is a .NET executable, you can also integrate it into your own applications.
https://www.microsoft.com/en-us/research/project/rex-regular-expression-exploration
Do you have a question or a suggestion about this post? Contact me!