[Haskell] ANNOUNCE: regex-genex-0.2.0

唐鳳 audreyt at audreyt.org
Wed May 25 12:35:43 CEST 2011


Hi all,

I've just released regex-genex 0.2.0 to Hackage:

    http://hackage.haskell.org/package/regex-genex-0.2.0

The main interface is this: 

    genex :: [String] -> IO [String]

Given a list of regular repressions, genex returns all possible strings that matches all of them. For example:

    Regex.Genex> genex ["\\d", "[123abc]"]
    ["2","3","1"]

Currently it recognizes the same pattern syntax as regex-tdfa, with full support for word boundaries (\b) and backreferences (\1 through \9).

The list is generated lazily, so this terminates quickly:

    Regex.Genex> fmap (take 10) (genex ["([abc]+)\\1"])
    ["bb","cc","aa","bbbb","cccc","aaaa","bcbc","acac","baba","abab"]

It uses the "sbv" SMT solver library, which requires the "yices" binary be present in PATH;
yices2 can be downloaded  from here: http://yices.csl.sri.com/download-yices2.shtml

Suggestions and feedback are most welcome. :-)

Cheers,
Audrey


More information about the Haskell mailing list