
Date: Wed, 11 May 2005 17:22:25 -0400 (Eastern Standard Time) From: "S. Alexander Jacobson"
Subject: [Haskell-cafe] subRegex bug? Am I misunderstanding the regex docs?
*MyMod> subRegex (mkRegex "\\." ) "foo.bar" "blah" "foo*** Exception: Text.Regex.Posix.regcomp: error in pattern
Under my Linux install, with ghc6.4, it doesn't throw an exception, but also doesn't return a correct result; it returns Just []. Under WindowsXP, ghc6.4, I get the exception you get; under hugs, it can't find subRegex, but matchRegex returns Just []. What does seem to work is
import Text.Regex.Posix
p1 = do r <- regcomp "\\." 0 b <- regexec r "foo.bar" putStr (show b)
why it's in the IO monad, I don't know. Where would I find the source? I browsed the ghc cvs at haskell.org, but can't find Text.Regex. John