Given a list of regexes, generate all possible strings that matches all of them
github.com
github.com
The ([String] -> IO [String]) API also generated a lazy list:
http://hackage.haskell.org/packages/archive/regex-genex/0.2.0/doc/html/Regex-Genex.html
so one can take only part of the output like this: Regex.Genex> fmap (take 5) (genex ["([abc]+)\\1"])
["bb","cc","aa","bbbb","cccc"]it's such a sweet idea, with an obvious implementation and use, that you'd think it would have been done before. but i've not heard of anything and am having a hard time finding a good search term that isn't swamped by regexp howtos.
[* ] having said that, if it's compiled to a dfa then it might not be. a lot depends on the implementation... [edit] oh, and since a dfa-related package is a dependency my guess is that he can't display this info, because duplication will be lost in the transformation. interesting.
The inspiration for this work is the Regexp::Genex module from CPAN: http://search.cpan.org/dist/Regexp-Genex/ -- though it uses a random-walk approach for character classes, instead of enumerating all possibilities.
regex-tdfa was only really used for parsing regexes, so it's certainly possible to find duplicates. That said, piping the output to "|perl -pe 's/.*\t//' | sort | uniq -d" is quite usable too. :-)
That means the naïve SMT-solver-based approach in genex will not apply to this problem... Links/suggestions to relevant research welcome! :-)