Warp [1] implements this, and also allows you to generate a list of all possible values matching a particular regex (the number of possibilities of course grows quite quickly for many regexes!).
- Generating all matching strings
- Generating a random matching string
- Counting the number of matching strings
- Simplification of regular expressions
https://github.com/asciimoo/exrex (AGPL licensed)I mainly used it to generate test mail addresses. For example, the following will generate 36 test email addresses:
(blue|red|yellow|green).(oak|cedar|willow)@(yahoo.co.uk|google.com|example.org)