in reply to back translating regular expressions

If you want to do this from scratch, you'll have to first parse regex using some grammar. You can use Parse::RecDescent, but make sure the grammar is right recursive. Once you get the parse tree, you can construct possible matches. If you want to handle kleene closures (*), then I would only generate the possibilies where there is no S and 1 S - don't go down the S* road unless you had to.

This is a very interesting problem, and I am currently working on a set of modules that let you play around with finite automatas for grad school. I have an NFA->DFA going, and I am about to do a RE->DFA; one of my additional goals is to iteratively generate a set of strings that can be produced given a DFA or RE.
  • Comment on Re: back translating regular expressions