The regex-compat docs say "Returns:if the match succeeded (and
Just
strsstrs
is the list of subexpression matches), orNothing
otherwise.”.Adam BergmarkOn Tue 05 Apr 2016 at 22:16 Jeffrey Brown <Jeffrey Brown > wrote:Esteemed Haskellers,It is working for me, but I am puzzled by the matchRegex function:> import Text.Regex> :i matchRegexmatchRegex :: Regex -> String -> Maybe [String]-- Defined in ‘Text.Regex’Searches that fail return Nothing:> matchRegex (mkRegex "z") "abracadabra"Nothingwhich makes sense. But why do searches that succeed return an empty list of Strings?> matchRegex (mkRegex "a") "abracadabra"Just []>--Jeffrey Benjamin Brown_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe