a very basic and wrong implementation of generating strings from regexp