All matches of regex in Haskell -



All matches of regex in Haskell -

according number of tutorials (including real world haskell) 1 can, using ghci following

ghci > :m text.regex.posix ghci > "foo foo foo" =~ "foo" :: [string] ["foo","foo","foo"]

yet, when effort this, yields

no instance (regexcontext regex [char] [string]) arising utilize of `=~' possible fix: add together instance declaration (regexcontext regex [char] [string]) in expression: "abc" =~ "ab" :: [string] in equation `it': = "abc" =~ "ab" :: [string]

what right way of obtaining list of matches in haskell?

the regex libraries can confusing overloaded homecoming types, matches need ensure homecoming type alltextmatches, example:

prelude> :m + text.regex.posix prelude text.regex.posix> getalltextmatches $ "foo foo foo" =~ "foo" :: [string] ["foo","foo","foo"]

regex haskell

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -