It is even simpler than that. The type determines the return value.<br><br>>"axxfayyf" =~ "a..f" :: Bool<br>True<br><br>>"axxfayyf" =~ "a..f" :: Int<br>2<br><br>>"axxfayyf" =~ "a..f" :: String<br>
"axxf"<br><br>>"axxfayyf" =~ "a..f" :: [[String]]<br>[["axxf"],["ayyf"]]<br><br>>"axxfayyf" =~ "a..f" :: [MatchArray]<br>[array (0,0) [(0,(0,4))],array (0,0) [(0,(4,4))]]<br>
<br>>"axxfayyf" =~ "a..f" :: (MatchOffset, MatchLength)<br>(0,4)<br><br>Among other contexts specified in :i RegexContext<br><br><div class="gmail_quote">On Tue, Jul 20, 2010 at 11:55 AM, Omari Norman <span dir="ltr"><<a href="mailto:omari@smileystation.com">omari@smileystation.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">> How do I use Text.Regex.PCRE to get information on multiple matches? For<br>
> instance, in ghci I get this error message:<br>
><br>
> Prelude Text.Regex.PCRE> "foo" =~ "o" :: [(Int,Int)]<br>
<br>
</div>Solved; do<br>
<br>
getAllMatches ("foo" =~ "o") :: [(Int, Int)]<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>