
#12974: Solution to regular expression is no longer valid ---------------------------------+-------------------------------------- Reporter: pjljvdlaar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: regex Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Comment (by RyanGlScott): Since I was curious to learn //how// the second test was failing, I cooked up a slight variant of the program: {{{#!hs {-# LANGUAGE PackageImports #-} module Main (main) where import "regex-compat" Text.Regex main :: IO () main = do print $ matchRegexAll (mkRegex "^(a)|(p)$") "p" print $ matchRegexAll (mkRegex "^(ab+c*d?)|(ef{2}g{3,6}h{3,})|(p)$") "p" }}} This requires the `regex-compat` package (a thin shim on top of `regex- posix`). With 32-bit Windows GHC, running this program gives you: {{{ Just ("","p","",[]) Just ("","p","",[]) }}} With 64-bit Windows GHC: {{{ Just ("","p","",["","p"]) Nothing }}} With 64-bit Linux GHC: {{{ Just ("","p","",["","p"]) Just ("","p","",["","","p"]) }}} The most likely culprits are the C files (`regex.h` and friends) that are shipped with `regex-posix`, as they're most likely quite old. I'll see if I can find a more up-to-date version. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12974#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler